#Include <GuiButton.au3>
#Include <GuiComboBox.au3>
#Include <GuiListBox.au3>
#Include <Function For PageViewer2.au3>
#Include <Excel.au3>
#include <WinAPI.au3>
#Include <GuiTab.au3>


Global $sFolderName                                         = 'PageViewer'
Global $sFunctionName                                       = 'PageViewer'
Global $sSampleFolderPath                                   = 'C:\AutomationTest\PageViewer\Sample\'
Global $sFunctionFolderPath                                 = 'C:\AutomationTest\PageViewer\'
Global $sCorrectResultPath                                  = 'C:\AutomationTest\PageViewer\Correct Result\'
Global $sPerformResultPath                                  = 'C:\AutomationTest\PageViewer\Perform Result\'
Global $sPageViwerAlertTitle                                = 'Presto! PageViewer' 
Global $sPageViwerAlertMsg                                  = 'OK' 
Global $sFilePropertiesWndTitle                             = 'File Properties' 
Global $sPageViewerSaveAnnoTitle                            = 'Presto! PageViewer' 
Global $sPageViewerSaveAnnoTitleText                        = '&Yes' 
Global $iAudioMemoCtrl                                      =  1024
Global $avTextAnnoPos[2]                                    = [610, 362]
Global $sStampsPrpertisWnd                                  = 'Stamps Properties'
Global $sAddImageStampWnd                                   = 'Add Image Stamp' 
Global $sAddTextStampWnd                                    = 'Add Text Stamp' 
Global $sModifyTextStampWnd                                 = 'Modify text stamp' 
Global $sModifyImageStampWnd                                = 'Modify bitmap stamp' 
Global $sColorWnd                                           = 'Color' 
Global $sLinePropertisWnd                                   = 'Line Properties' 
Global $sStickyNoteWnd                                      = 'Sticky Note' 
Global $sFontWnd                                            = 'Font'
Global $sEraserSettingsWnd                                  = 'Eraser Settings'
Global $sYes                                                = '&Yes'
Global $sNO                                                 = '&No'
Global $sSetBrightnessAndContrastWnd                        = 'Set Brightness and Contrast'
Global $sColorAdjustmentWnd                                 = 'Color Adjustment'
Global $sSaveAsWndText                                      = 'FolderView'
Global $sConfirmSaveAsWnd                                   = 'Confirm Save As'
Global $sSettingsWnd                                        = 'Settings'
Global $sPasswordWnd                                        = 'Password'
Global $sMenuClass                                          = "[CLASS:#32768]"
Global $sTextBoxPropertiesWnd                               = 'Text Box Properties'
Global $sCalloutPropertiesWnd                               = 'Callout Properties'
Global $sStickyNotePropertiesPropertiesWnd                  = 'Sticky Note Properties'
Global $sStampPropertiesWnd                                 = 'Stamp Properties'
Global $sOpenWnd                                            = 'Open'
Global $sOpenWndText                                        = '&Open'
Global $sFileAttachmentPropertiesWnd                        = 'File Attachment Properties'
Global $sInsertCaretPropertiesWnd                           = 'Insert Caret Properties'
Global $sCrossOutPropertiesWnd                              = 'Cross-Out Properties'
Global $sUnderlinePropertiesPropertiesWnd                   = 'Underline Properties'
Global $sHighlightPropertiesWnd                             = 'Highlight Properties'
Global $sOvalPropertiesWnd                                  = 'Oval Properties'
Global $sRectanglePropertiesWnd                             = 'Rectangle Properties'
Global $sLinePropertiesWnd                                  = 'Line Properties'
Global $sPolygonPropertiesWnd                               = 'Polygon Properties'
Global $sPolygonLinePropertiesWnd                           = 'Polygon Line Properties'
Global $sPencilMarkPropertiesWnd                            = 'Pencil Mark Properties'
Global $sBatesNumberingWnd                                  = 'Bates Numbering'
Global $sBatesOptionsWnd                                    = 'Bates Options'
Global $sRedactionOptionsWnd                                = 'Redaction Options'
Global $sSearchandRedactWnd                                 = 'Search and Redact'
Global $sCreateLinkWnd                                      = 'Create Link'
Global $sCreategotoviewWnd                                  = 'Create go to view'
Global $sPreferencesWnd                                     = 'Preferences'
Global $sSaveAsImage                                        = 'Save As Image'
Global $sSaveAllFilesAsWnd                                  = 'Save All Files As'
Global $sSplitPDFSettingsWnd                                = 'Split PDF Settings'
Global Const $iTAB_CTRL_INFO                                = 1009
Global Const $RIGHT_LOWER_CORNER_POSITION[2]                = [788, 875]
Global $avSample[45] = ['TIFF_uncompressed.tif', _
					   'TIFF-packbits.tif', _
					   'TIFF-G3.tif', _
					   'TIFF-G4.tif', _
					   'M-TIFF-Single page.tif' , _
					   'M-TIFF-multiple page.tif', _
					   'JPG.jpg', _
					   'JPEG.jpg', _
					   'BMP.bmp', _
					   'PCX.pcx', _
					   'PCT.pct', _
					   'TGA.tga', _
					   'WMF.wmf', _
					   'PSD.psd', _
					   'JPEG.jpg', _
					   'PNG.png', _
					   'PCD.pcd', _
					   'GIF.gif', _
					   'DOC.doc', _
					   'DOCX.docx', _
					   'DOCM.docm', _
					   'XLS.xls', _
					   'XLSX.xlsx', _
					   'XLSM.xlsm', _
					   'PPT.ppt', _
					   'PPTM.pptm', _
					   'PPTX.pptx', _
					   'RTF.rtf', _
					   'TXT.TXT', _
					   'VSS.VSS', _
					   'VSD.VSD', _
					   'VST.VST', _
					   'PPS.pps', _
					   'PPSX.ppsx', _
					   'PPSM.ppsm', _
					   'MPP.mpp', _
					   'XML.xml', _
					   'HTML.html', _
					   'HTM.htm', _
					   'MHT.mht', _
					   'PDF-Single page.pdf', _
					   'PDF-multiple page.PDF', _
					   'PDF-Protect-PDF.pdf', _
					   'XPS-Single page.xps', _
					   'XPS-multiple page.xps'];   , _
					   
Global $avSample_2[26] = ['ThisIsForTest.exe', _
					   'Test.zip', _
					   'WAV.WAV', _
					   'PDF-Single page.pdf', _
					   'DOC.doc', _
					   'DOCX.docx', _
					   'DOCM.docm', _
					   'XLS.xls', _
					   'XLSX.xlsx', _
					   'XLSM.xlsm', _
					   'PPT.ppt', _
					   'PPTM.pptm', _
					   'PPTX.pptx', _
					   'RTF.rtf', _
					   'TXT.TXT', _
					   'VSS.VSS', _
					   'VSD.VSD', _
					   'VST.VST', _
					   'PPS.pps', _
					   'PPSX.ppsx', _
					   'PPSM.ppsm', _
					   'MPP.mpp', _
					   'XML.xml', _
					   'HTML.html', _
					   'HTM.htm', _
					   'MHT.mht'];   , _
					   
					   
Global $avSample_1[19] = ['DOC.doc', _
					   'DOCX.docx', _
					   'DOCM.docm', _
					   'XLS.xls', _
					   'XLSX.xlsx', _
					   'XLSM.xlsm', _
					   'PPT.ppt', _
					   'PPTM.pptm', _
					   'PPTX.pptx', _
					   'RTF.rtf', _
					   'TXT.TXT', _
					   'VSS.VSS', _
					   'VSD.VSD', _
					   'VST.VST', _
					   'PPS.pps', _
					   'PPSX.ppsx', _
					   'PPSM.ppsm', _
					   'MPP.mpp', _
					   'XML.xml']
					   
Global $avSampleImage[18] = ['TIFF_uncompressed.tif', _
					   'TIFF-packbits.tif', _
					   'TIFF-G3.tif', _
					   'TIFF-G4.tif', _
					   'M-TIFF-Single page.tif' , _
					   'M-TIFF-multiple page.tif', _
					   'JPG.jpg', _
					   'JPEG.jpg', _
					   'BMP.bmp', _
					   'PCX.pcx', _
					   'PCT.pct', _
					   'TGA.tga', _
					   'WMF.wmf', _
					   'PSD.psd', _
					   'JPEG.jpg', _
					   'PNG.png', _
					   'PCD.pcd', _
					   'GIF.gif']	
					   					   
					   
Global $avImageSaveAsFormat[18] = ["BMP(*.BMP)", _
					   "PaintBrush(*.PCX)", _
					   "TIFF-uncompressed(*.TIF)", _
					   "TIFF-packbits(*.TIF)", _
					   "TIFF-G3 compression(*.TIF)", _
					   "TIFF-G4 compression(*.TIF)", _
					   "TIFF-multiple page(*.TIF)", _
					   "JPEG(*.JPG)", _
					   "PICT(*.PCT)", _
					   "Targa(*.TGA)", _
					   "Targa-rle(*.TGA)", _
					   "PNG(*.PNG)", _
					   "Photoshop(*.PSD)", _
					   "GIF(*.GIF)", _
					   "Text(*.TXT)", _
					   "Rich Text Format(*.RTF)", _
					   "HTML(*.HTM)", _
					   "XPS File(*.xps)"]	
								
				
Global $avImageSaveAsFormat_1[14] = ["BMP(*.BMP)", _
					   "PaintBrush(*.PCX)", _
					   "TIFF-uncompressed(*.TIF)", _
					   "TIFF-packbits(*.TIF)", _
					   "TIFF-G3 compression(*.TIF)", _
					   "TIFF-G4 compression(*.TIF)", _
					   "TIFF-multiple page(*.TIF)", _
					   "JPEG(*.JPG)", _
					   "PICT(*.PCT)", _
					   "Targa(*.TGA)", _
					   "Targa-rle(*.TGA)", _
					   "PNG(*.PNG)", _
					   "Photoshop(*.PSD)", _
					   "GIF(*.GIF)"]						   

Global Const $AVARROWS_END_STYLE[10] =['None', _
						'Open', _
						'Closed', _
						'Open(Reverse)', _
						'Close(Reverse)', _
						'Butt', _
						'Diamond', _
						'Round', _
						'Square', _
						'Slash']
						
Global Const $AVICON_STYLE[15] =['Check', _
						'Oval', _
						'Comment', _
						'Cross', _
						'Help', _
						'Insert', _
						'Key', _
						'NewParagraph', _
						'Note', _
						'Paragraph', _
						'RightArrow', _
						'RightPoint', _
						'Start', _
						'UpArrow', _
						'UpLeftArrow']
						
Global Const $LINE_STYLE[9] =['Line','Dot','DotLine','Dash','DotDash','ShortDotDash','LongDotDash','ShortSquiggly','LongSquiggly']
Global Const $LINE_STYLE2[7] =['Line','Dot','DotLine','Dash','DotDash','Short Dotted Dash','Long Dotted Dash']
Func InitializeStatusForPageViewer()
	Local $FileList=_FileListToArray($sFunctionFolderPath, '*', 1)
	If @Error Then Return
	For $i = 1 to $FileList[0]
		FileDelete($sFunctionFolderPath & $FileList[$i])
	Next
EndFunc	

Func IsPageViewerWindowExist($TestCaseID, $sLogFileName1)
	If WinWait($sPageViwerWindowClass, '', 15) Then
		Common_SleepInSeconds(5)
		If WinExists('Password', 'OK')  Then
			Send('123')
			Common_SleepInSeconds(1)
			Send('{ENTER}')
			Common_SleepInSeconds(5)
		EndIf
		WinActivate($sPageViwerWindowClass)
		Return WinGetHandle($sPageViwerWindowClass)
	EndIf
	Common_WriteLog($sFaile & 'IsPageViewerWindowExist($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return ''
EndFunc

Func ClickPageManagerFolderInQuckLink($hPMHandle)
	#cs
	$hQuickLinkWnd = ControlGetHandle($hPMHandle, '', 'SysListView321')
	_GUICtrlListView_ClickItem($hQuickLinkWnd, 2)
	#ce
	Common_SleepInSeconds(1)
	MouseClick('left',56, 143)
	Common_SleepInSeconds(1)
EndFunc

Func SwitchToPageViewerFromViewMenu()
	Send('!v')
	Common_SleepInSeconds(0.5)
	Send('s')
	Common_SleepInSeconds(0.5)
	Send('{RIGHT}')
	Common_SleepInSeconds(0.5)
	Send('p')
	Common_SleepInSeconds(7)
EndFunc


Func SwitchToPageViewerFromContextMenu($hThumbnailView, $ipos)
	_GUICtrlListView_ClickItem($hThumbnailView, $ipos, "right")
	Common_SleepInSeconds(0.5)
	Send('s')
	Common_SleepInSeconds(0.5)
	Send('{RIGHT}')
	Common_SleepInSeconds(0.5)
	Send('p')
	Common_SleepInSeconds(10)
EndFunc


Func SwitchToPageViewerByDoubleClick($hThumbnailView, $ipos)
	_GUICtrlListView_ClickItem($hThumbnailView, $ipos, "left", False, 2)
	Common_SleepInSeconds(3)
	Send('{ENTER}')
	Common_SleepInSeconds(6)
EndFunc


Func ExitPageViewerFromFileMenu($hPageViewer)
	WinActivate($hPageViewer)
	Send('!f')
	Common_SleepInSeconds(0.5)
	Send('e')
	Common_SleepInSeconds(1.5)
EndFunc

Func ExitPageViewerByClickCloseButton($hPageViewer)
	WinActivate($hPageViewer)
	MouseClick('left', 1267, 10)
	Common_SleepInSeconds(1.5)
EndFunc

Func ExitPageViewerByClickBackMenu($hPageViewer)
	WinActivate($hPageViewer)
	Send('!f')
	Common_SleepInSeconds(0.5)
	Send('b')
	Common_SleepInSeconds(1.5)
EndFunc

Func ExitPageViewerByClickBackButton($hPageViewer)
	WinActivate($hPageViewer)
	MouseClick('left', 37, 55)
	Common_SleepInSeconds(1.5)
EndFunc

Func OpenFileInPagewier($sFile, $TestCaseID, $sLogFileName1)
	Send('^o') 
	Local $sTitle = 'Open'
	Local $sTest = 'Cancel'
	If WinWait($sTitle, $sTest, 10) Then
		WinActive($sTitle, $sTest)
		ControlSetText($sTitle, $sTest, 1148, $sFile)
		Common_SleepInSeconds(0.5)
		ControlClick($sTitle, $sTest, 1)
		Common_SleepInSeconds(1.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'IsPageViewerWindowExist($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectFileInFileListForPageViewer($fileOrder, $sMouseButton)
	If $fileOrder == 2 Then
		MouseClick($sMouseButton, 41,209)
	EndIf
	If $fileOrder == 1 Then
		MouseClick($sMouseButton, 41,145)
	EndIf
	;_GUICtrlListView_ClickItem(ControlGetHandle($hPageViewer, '', 'SysListView321'), $fileOrder ,$sMouseButton, True)
	Common_SleepInSeconds(1.5)
EndFunc

Func ClickFileThumbnailInPageViwer($fileOrder, $sMouseButton)
	;_GUICtrlListView_ClickItem(ControlGetHandle($hPageViewer, '', 333), $fileOrder ,$sMouseButton)
	If $fileOrder == 1 Then
		MouseClick($sMouseButton, 162, 176)
	EndIf
	Common_SleepInSeconds(1.5)
EndFunc

Func OpenViewGoToMenu()
	Send('!v')
	Common_SleepInSeconds(0.5)
	Send('g')
	Common_SleepInSeconds(0.5)
EndFunc

Func DoubleClickPageNumberEditBox()
	MouseClick('left', 422, 67, 4)
	Common_SleepInSeconds(1)
EndFunc

Func ZoomOutInPageViwer($sSzie)
	Send('!v')
	Common_SleepInSeconds(0.5)
	Send('z')
	Common_SleepInSeconds(0.5)
	Send('o')
	Common_SleepInSeconds(0.5)
	If $sSzie == '1/2' Then
	ElseIf $sSzie == '1/3' Then
		For $i = 0 to 0
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == '1/4' Then
		For $i = 0 to 1
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == '1/5' Then
		For $i = 0 to 2
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == '1/6' Then
		For $i = 0 to 3
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == '1/7' Then
		For $i = 0 to 4
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == '1/8' Then
		For $i = 0 to 5
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	EndIf
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func ZoomInInPageViwer($sSzie)
	Send('!v')
	Common_SleepInSeconds(0.5)
	Send('z')
	Common_SleepInSeconds(0.5)
	Send('i')
	Common_SleepInSeconds(0.5)
	If $sSzie == 'x2' Then
	ElseIf $sSzie == 'x3' Then
		For $i = 0 to 0
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == 'x4' Then
		For $i = 0 to 1
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == 'x5' Then
		For $i = 0 to 2
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == 'x6' Then
		For $i = 0 to 3
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == 'x7' Then
		For $i = 0 to 4
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	ElseIf $sSzie == 'x8' Then
		For $i = 0 to 5
			Send('{DOWN}')
			Common_SleepInSeconds(0.3)
		Next
	EndIf
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickZoomOutBtnInPageViwerStatusBar()
	MouseClick('left', 1141, 1007)
	Common_SleepInSeconds(0.3)
EndFunc

Func ClickZoomInBtnInPageViwerStatusBar()
	MouseClick('left', 1250, 1007)
	Common_SleepInSeconds(0.3)
EndFunc

Func DragDropZoomBtnInPageViwerStatusBar($pos)
	If $pos == 'Max' Then
		MouseClickDrag ( 'left',1199, 1007, 1124, 1007)
	ElseIf $pos == 'Min' Then
		MouseClickDrag ( 'left',1199, 1007, 1262, 1007)
	EndIf
	Common_SleepInSeconds(0.5)
EndFunc

Func DragDropZoomBtnInPageViwerStatusBar_($pos)
	If $pos == 'Max' Then
		MouseClickDrag ( 'left',1188, 1008, 1124, 1007,90)
	ElseIf $pos == 'Min' Then
		MouseClickDrag ( 'left',1188, 1008, 1262, 1007,90)
	EndIf
	Common_SleepInSeconds(0.5)
EndFunc

Func OpenViewZoomMenu()
	Send('!v')
	Common_SleepInSeconds(0.5)
	Send('z')
	Common_SleepInSeconds(0.5)
EndFunc

Func ScreenCapturePageViwerStatusBar($sPerformResultPath)
	_ScreenCapture_Capture($sPerformResultPath, 7,996, 1263,1020, False)
EndFunc

Func ScreenCapturePageViwerAnnotationBar($sPerformResultPath)
	_ScreenCapture_Capture($sPerformResultPath, 1080,87, 1270, 848, False)
EndFunc

Func RightClickTaskPane()
	MouseClick('right',1147, 92)
	Common_SleepInSeconds(0.5)
EndFunc

Func DoubleClickTaskPane()
	MouseClick('left', 1147, 92, 3)
	Common_SleepInSeconds(1)
EndFunc

Func DockFloatedTaslPane()
	For $i = 0 to 1 
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(1)
EndFunc


Func DoubleClickFolatedTaskPane()
	MouseClick('left',336, 106, 3)
	Common_SleepInSeconds(1)
EndFunc

Func ClickViewEditToolsMenu()
	Send('!v')
	Common_SleepInSeconds(0.5)
	Send('{UP}')
	Common_SleepInSeconds(0.5)
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func FloatingTaskpane()
	RightClickTaskPane()
	Send('{DOWN}')
	Common_SleepInSeconds(0.5)
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func HideFloatingTaskpane()
	Send('{UP}')
	Common_SleepInSeconds(0.3)
	Send('{ENTER}')
	Common_SleepInSeconds(1)
EndFunc

Func MouseClickFloatingTaskPane($btn,$clickNumber)
	MouseClick($btn,334, 100, $clickNumber)
EndFunc

Func OpenFilePropertiesFromFileMenu()
	Send('!f')
	Common_SleepInSeconds(1)
	For $i = 0 to 1 
		Send('{UP}')
		Common_SleepInSeconds(0.3)
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(1)
EndFunc

Func ClickFilePropertitesInPageViwer($TestCaseID, $sLogFileName1)
	MouseClick('right',800,279)
	Common_SleepInSeconds(0.5)
	Send('{UP}')
	Common_SleepInSeconds(0.3)
	Send('{ENTER}')
	Common_SleepInSeconds(1)
	If WinWait ($sFilePropertiesWndTitle, '', 10) Then
		WinActive($sFilePropertiesWndTitle)
		ControlFocus($sFilePropertiesWndTitle, '', 1032)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickFilePropertitesInPageViwer($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func AddAuthorsInFileProperties($sName, $TestCaseID, $sLogFileName1)
	Local $sAuthorTitle = 'Add/Remove Authors'
	ControlClick($sFilePropertiesWndTitle, '', 1031)   ; add or remove button
	if WinWait($sAuthorTitle, '', 10) Then
		Common_SleepInSeconds(1)
		WinActive($sAuthorTitle)
		ControlSetText($sAuthorTitle, '', 1059, $sName)
		Common_SleepInSeconds(0.3)
		ControlClick($sAuthorTitle, '', 1056)   ; add button
		Common_SleepInSeconds(0.3)
		ControlClick($sAuthorTitle, '', 1)   ; OK button
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'AddAuthorsInFileProperties($sName, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func RemoveAuthorsInFileProperties($iIndex, $TestCaseID, $sLogFileName1)
	Local $sAuthorTitle = 'Add/Remove Authors'
	ControlClick($sFilePropertiesWndTitle, '', 1031)   ; add or remove button
	If WinWait($sAuthorTitle, '', 10) Then	
		Common_SleepInSeconds(1)
		WinActive($sAuthorTitle)
		$hListBox = ControlGetHandle($sAuthorTitle, '', 1058)
		_GUICtrlListBox_ClickItem($hListBox,$iIndex)
		Common_SleepInSeconds(0.2)
		ControlClick($sAuthorTitle, '', 1057)   ; remove button
		Common_SleepInSeconds(0.3)
		ControlClick($sAuthorTitle, '', 1)   ; OK button
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'RemoveAuthorsInFileProperties($iIndex, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func AddKeywordsInFileProperties($sName, $TestCaseID, $sLogFileName1)
	Local $sAuthorTitle = 'Add/Remove Keywords'
	ControlClick($sFilePropertiesWndTitle, '', 1032)   ; add or remove button
	If WinWait($sAuthorTitle, '', 10) Then
		Common_SleepInSeconds(1)
		WinActive($sAuthorTitle)
		ControlSetText($sAuthorTitle, '', 1059, $sName)
		Common_SleepInSeconds(0.3)
		ControlClick($sAuthorTitle, '', 1056)   ; add button
		Common_SleepInSeconds(0.3)
		ControlClick($sAuthorTitle, '', 1)   ; OK button
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'AddKeywordsInFileProperties($sName, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func RemoveKeywordsInFileProperties($iIndex, $TestCaseID, $sLogFileName1)
	Local $sAuthorTitle = 'Add/Remove Keywords'
	ControlClick($sFilePropertiesWndTitle, '', 1032)   ; add or remove button
	If WinWait($sAuthorTitle, '', 10) Then
		Common_SleepInSeconds(1)
		WinActive($sAuthorTitle)
		$hListBox = ControlGetHandle($sAuthorTitle, '', 1058)
		_GUICtrlListBox_ClickItem($hListBox,$iIndex)
		Common_SleepInSeconds(0.2)
		ControlClick($sAuthorTitle, '', 1057)   ; remove button
		Common_SleepInSeconds(0.3)
		ControlClick($sAuthorTitle, '', 1)   ; OK button
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'RemoveKeywordsInFileProperties($iIndex, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func AddMemoInFileProperties($sMemo)
	ControlFocus($sFilePropertiesWndTitle, '', 1023)
	Common_SleepInSeconds(0.3)
	ControlSend($sFilePropertiesWndTitle, '', 1023, $sMemo)
	Common_SleepInSeconds(0.2)
	ControlFocus($sFilePropertiesWndTitle, '', 1)
	Common_SleepInSeconds(0.3)
EndFunc

Func AddAudioInFileProperties($sFile, $TestCaseID, $sLogFileName1)
	Local $sTitle = 'Open'
	ControlClick($sFilePropertiesWndTitle, '', 1025)   ;add button
	If WinWait($sTitle, '', 10) Then
		Common_SleepInSeconds(1)
		WinActive($sTitle)
		ControlSetText($sTitle, '', 1148, $sFile)
		Common_SleepInSeconds(0.3)
		ControlClick($sTitle, '', 1)   ;OK button
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'AddAudioInFileProperties($sFile,$TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func RecordAudioInFileProperties($TestCaseID, $sLogFileName1)
	Local $sTitle = 'Audio Recorder'
	ControlClick($sFilePropertiesWndTitle, '', 1028)   ;record button
	If WinWait($sTitle, '', 10) Then
		Common_SleepInSeconds(1)
		WinActive($sTitle)
		ControlClick($sTitle, '', 2464)    ;record button
		Common_SleepInSeconds(3)
		ControlClick($sTitle, '', 2463)    ;stop button
		Common_SleepInSeconds(0.5)
		ControlClick($sTitle, '', 1)    ;OK button
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'RecordAudioInFileProperties($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func PlayAuiodInFileProperties($TestCaseID, $sLogFileName1)
	Local $sTitle = 'Play Audio'
	ControlClick($sFilePropertiesWndTitle, '', 1027)   ;record button
	If WinWait($sTitle, '', 10) Then
		Common_SleepInSeconds(1)
		WinActive($sTitle)
		ControlClick($sTitle, '', 2472)    ;stop button
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'PlayAuiodInFileProperties($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func CliclFileLabelInileProperties($TestCaseID, $sLogFileName1)
	$hTabCtrl = ControlGetHandle($sFilePropertiesWndTitle, '', 12320)
	If $hTabCtrl<> '' Then
		_GUICtrlTab_ClickTab($hTabCtrl, 1)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'CliclFileLabelInileProperties($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func RotataImageImPageViwer($sDegree)
	Send('!t')
	Common_SleepInSeconds(0.5)
	Send('r')
	Common_SleepInSeconds(0.5)
	If $sDegree == 'Left90Degree' Then
		Send('l')
	ElseIf $sDegree == 'Right90Degree' Then
		Send('r')
	ElseIf $sDegree == '180Degree' Then	
		Send('1')
	EndIf
	Common_SleepInSeconds(1)
EndFunc

Func SelectSelectImageOptionInPageViewer()
	Send('!i')
	Common_SleepInSeconds(0.4)
	Send('{DOWN}')
	Common_SleepInSeconds(0.4)
	Send('{ENTER}')
	Common_SleepInSeconds(0.4)
EndFunc

Func SelectImagaAreInPageViewer()
	SelectSelectImageOptionInPageViewer()
	MouseClickDrag('left',437, 220, 734, 577)
	Common_SleepInSeconds(0.5)
EndFunc

Func AddTextAnnotationInPageViewer()
	MouseClick('left',1109, 213)   ;Text anno button
	Common_SleepInSeconds(0.3)
	MouseClick('left',585, 356)   ;Image area
	Common_SleepInSeconds(0.3)
	Send('This Text Annotation!')
	Common_SleepInSeconds(1)
EndFunc

Func AddTextAnnotationInPageViewer_EX($str)
	MouseClick('left',1109, 213)   ;Text anno button
	Common_SleepInSeconds(0.3)
	MouseClick('left',585, 356)   ;Image area
	Common_SleepInSeconds(0.3)
	Send($str)
	Common_SleepInSeconds(1)
EndFunc

Func ClickButtonOnPageViewerSaveAnooDlg($sBtn, $TestCaseID, $sLogFileName1)
	If WinWait($sPageViewerSaveAnnoTitle, $sPageViewerSaveAnnoTitleText, 10) Then
		If $sBtn = 'YES' Then
			ControlClick($sPageViewerSaveAnnoTitle, $sPageViewerSaveAnnoTitleText, 6)
		ElseIf $sBtn = 'NO' Then
			ControlClick($sPageViewerSaveAnnoTitle, $sPageViewerSaveAnnoTitleText, 7)
		EndIf
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickButtonOnPageViewerSaveAnooDlg($sBtn, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickOCRButtonInPageviewer()
	MouseClick('left',222, 61)
	Common_SleepInSeconds(20)
EndFunc

Func PerformOCRFromToolsMenu()
	Send('!t')
	Common_SleepInSeconds(0.5)
	Send('o')
	Common_SleepInSeconds(20)
EndFunc

Func ClickShowAnnotationInContextMenu()
	MouseClick('right', 668, 371)
	Common_SleepInSeconds(0.5)
	For $i = 0 to 1
		Send('{UP}')
		Common_SleepInSeconds(0.5)
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(1)
EndFunc

Func SelectMoveOptionImageMenu()
	Send('!i')
	Common_SleepInSeconds(0.5)
	Send('{ENTER}')
	Common_SleepInSeconds(1)	
EndFunc

Func ClickShowAnnotationInImageMenu()
	Send('!i')
	Common_SleepInSeconds(0.5)
	Send('{UP}')
	Common_SleepInSeconds(0.5)
	Send('{ENTER}')
	Common_SleepInSeconds(1)
EndFunc

Func GetAutioMemoCtrlHandle()
	$h = ControlGetHandle($sFilePropertiesWndTitle, '', $iAudioMemoCtrl)
	If $h <> '' Then
		Return $h 
	Else
		Return False
	EndIf	
EndFunc

Func ChangeTextFont($sTitle)
		Common_SleepInSeconds(1)
		WinActivate($sTitle)
		ControlClick($sTitle, '', 'ComboLBox1')
		For $i = 0 to 1 
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
		ControlClick($sTitle, '', 'ComboLBox2')
		For $i = 0 to 1 
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
		ControlClick($sTitle, '', 'ComboLBox3')
		For $i = 0 to 1 
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next		
		ControlClick($sTitle,'',1041)
		Common_SleepInSeconds(0.2)
		ControlClick($sTitle,'',1040)
		Common_SleepInSeconds(0.5)
		ControlClick($sTitle,'',1)   ;OK button
		Common_SleepInSeconds(1)
EndFunc


Func ChangeTextAnnotationFont($TestCaseID, $sLogFileName1)
	Local $sTitle = 'Font'
	MouseClick('left', 1128, 212)
	Common_SleepInSeconds(0.5)
	Send('f')
	If WinWait($sTitle, '', 10) Then
		ChangeTextFont($sTitle)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeTextAnnotationFont($TestCaseID, $sLogFileName1))', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ChangeTextAnnotationFontFromImageMenu($TestCaseID, $sLogFileName1)
	Local $sTitle = 'Font'
	Send('!i')
	Common_SleepInSeconds(0.5)
	For $i = 0 To 2
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)
	Next
		Send('{RIGHT}')
		Common_SleepInSeconds(0.2)
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)
		Send('{ENTER}')
	If WinWait($sTitle, '', 10) Then
		ChangeTextFont($sTitle)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeTextAnnotationFontFromImageMenu($TestCaseID, $sLogFileName1))', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickSelectAnnotationButton()
	MouseClick('left',1182,146)
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickDownArrowOfStampButton()
	MouseClick('left',1128,250)
	Common_SleepInSeconds(0.5)	
EndFunc

Func ClickDownArrowOfInsertCaretBtn($TestCaseID, $sLogFileName1)
	MouseClick('left',1128, 314)
	Common_SleepInSeconds(0.5)	
	Send('{DOWN}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')	
	If WinWait($sInsertCaretPropertiesWnd, '', 5) Then
		WinActivate($sInsertCaretPropertiesWnd)
		Common_SleepInSeconds(0.5)	
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDownArrowOfInsertCaretBtn($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False			
EndFunc

Func CliclStickyNoteButton()
	MouseClick('left',1152,250)
	Common_SleepInSeconds(0.5)	
EndFunc

Func AddStickyNoteAnnotationInStickyNoteWnd($TestCaseID, $sLogFileName1, $sText)
	CliclStickyNoteButton()
	MouseClick('left',573,376)
	If WinWait($sStickyNoteWnd, '', 5) Then
		WinActivate($sStickyNoteWnd)
		Common_SleepInSeconds(1)	
		Send($sText)
		Common_SleepInSeconds(0.2)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'AddStickyNoteAnnotationInStickyNoteWnd($TestCaseID, $sLogFileName1, $sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickOKBtnOnStickyNoteWnd($TestCaseID, $sLogFileName1)
	If WinExists($sStickyNoteWnd) Then
		ControlClick($sStickyNoteWnd, '', 1)
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickOKBtnOnStickyNoteWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickFontBtnOnStickyNoteWnd($TestCaseID, $sLogFileName1)
	If WinExists($sStickyNoteWnd) Then
		ControlClick($sStickyNoteWnd, '', 2161)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickFontBtnOnStickyNoteWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickBackgroudBtnOnStickyNoteWnd($TestCaseID, $sLogFileName1)
	If WinExists($sStickyNoteWnd) Then
		ControlClick($sStickyNoteWnd, '', 2197)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickFontBtnOnStickyNoteWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickAdjustSzieBtnOnStickyNoteWnd($TestCaseID, $sLogFileName1,$state)
	If WinExists($sStickyNoteWnd) Then
		$id = 2204
		$h = ControlGetHandle($sStickyNoteWnd, '', $id)
		If $state == 'Check' Then
			If _GUICtrlButton_GetState($h) <> 1 Then
				ControlClick($sStickyNoteWnd, '', $id)
			EndIf
		ElseIf $state == 'Uncheck' Then 	
			If _GUICtrlButton_GetState($h) == 1 Then
				ControlClick($sStickyNoteWnd, '', $id)
			EndIf		
		EndIf
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickFontBtnOnStickyNoteWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickStampButton()
	MouseClick('left',1107,251)
	Common_SleepInSeconds(0.5)		
EndFunc

Func AddStampAnnotation()
	ClickDownArrowOfStampButton()
	For $i = 0 to 3
		Send('{DOWN}')
		Common_SleepInSeconds(0.1)	
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(0.3)	
	MouseClick('left',585, 356)   
	Common_SleepInSeconds(0.5)	
EndFunc

Func OpenStamProPertiesWnd($TestCaseID, $sLogFileName1)
	If WinGetHandle($sStampsPrpertisWnd) <> '' Then Return True
	ClickDownArrowOfStampButton()
	Send('{UP}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	If WinWait ($sStampsPrpertisWnd, '', 10) Then
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'OpenStamProPertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func SetAddImageStampName($sName, $TestCaseID, $sLogFileName1)
	If Not OpenStamProPertiesWnd($TestCaseID, $sLogFileName1) Then Return False
	If WinGetHandle($sAddImageStampWnd) == '' Then ControlClick($sStampsPrpertisWnd, '', 2087)
	If WinWait($sAddImageStampWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sAddImageStampWnd)
		ControlSend($sAddImageStampWnd, '', 2082, $sName)
		ControlFocus($sAddImageStampWnd, '', 1)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetAddImageStampName($sName, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func AddImageStamp($sFileType, $TestCaseID, $sLogFileName1)
	Local $sText = 'File &name:'
	If Not OpenStamProPertiesWnd($TestCaseID, $sLogFileName1) Then Return False
	If WinGetHandle($sAddImageStampWnd) == '' Then ControlClick($sStampsPrpertisWnd, '', 2087)
	If WinWait($sAddImageStampWnd, '', 10) Then
		Common_SleepInSeconds(1)
		ControlClick($sAddImageStampWnd, '', 2150)   ;Browse button
		If WinWait($sAddImageStampWnd, $sText, 10)  Then
			Common_SleepInSeconds(1)
			WinActivate($sAddImageStampWnd)
			If $sFileType == 'BMP' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'BMP.bmp')
			ElseIf $sFileType == 'PCX' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'PCX.pcx')
			ElseIf $sFileType == 'TIF' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'M-TIFF-Single page.tif')
			ElseIf $sFileType == 'JPEG' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'JPEG.jpg')
			ElseIf $sFileType == 'PCT' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'PCT.pct')
			ElseIf $sFileType == 'TGA' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'TGA.tga')
			ElseIf $sFileType == 'PNG' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'PNG.png')	
			ElseIf $sFileType == 'PCD' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'PCD.pcd')					
			EndIf
			Common_SleepInSeconds(0.6)
			ControlClick($sAddImageStampWnd, $sText, 1)   ;Open button
			Common_SleepInSeconds(2)
			ControlFocus($sAddImageStampWnd, '', 2160)
			Common_SleepInSeconds(1)
			Return True
		Else
		Common_WriteLog($sFaile & ' AddImageStamp($sFileType, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
		Common_ClosePMWhenException()
		Return False
		EndIf
	EndIf
	Common_WriteLog($sFaile & ' AddImageStamp($sFileType, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SetAddTextStampName($sName, $TestCaseID, $sLogFileName1)
	If Not OpenStamProPertiesWnd($TestCaseID, $sLogFileName1) Then Return False
	If WinGetHandle($sAddTextStampWnd) == '' Then 
		ControlClick($sStampsPrpertisWnd, '', 2089)
	EndIf
	If WinWait($sAddTextStampWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sAddTextStampWnd)
		ControlSend($sAddTextStampWnd, '', 2082, $sName)
		ControlFocus($sAddTextStampWnd, '', 1)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetAddTextStampName($sName, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func AddTextStamp($sName, $TestCaseID, $sLogFileName1)
	If Not OpenStamProPertiesWnd($TestCaseID, $sLogFileName1) Then Return False
	If WinGetHandle($sAddTextStampWnd) == '' Then 
		ControlClick($sStampsPrpertisWnd, '', 2089)
	EndIf
	If WinWait($sAddTextStampWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sAddTextStampWnd)
		ControlSend($sAddTextStampWnd, '', 2080, $sName)
		ControlFocus($sAddTextStampWnd, '', 1)
		Common_SleepInSeconds(5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'AddTextStamp($sName, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickDeleteButtonOfStampPropertiesWnd($TestCaseID, $sLogFileName1)
	If WinExists($sStampsPrpertisWnd) Then
		Common_SleepInSeconds(0.5)
		ControlClick($sStampsPrpertisWnd, '', 2090)  ;delete button
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDeleteButtonOfStampPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickModifyButtonOfStampPropertiesWnd($TestCaseID, $sLogFileName1)
	If WinExists($sStampsPrpertisWnd) Then
		Common_SleepInSeconds(0.5)
		ControlClick($sStampsPrpertisWnd, '', 2088)  ;modify button
		Common_SleepInSeconds(1)
		ControlFocus($sStampsPrpertisWnd, '', 2160)   ;Focus on preview
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickModifyButtonOfStampPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickOKButtonOfStampPropertiesWnd($TestCaseID, $sLogFileName1)
	If WinExists($sStampsPrpertisWnd) Then
		Common_SleepInSeconds(0.5)
		ControlClick($sStampsPrpertisWnd, '', 1)  ;OK button
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickOKButtonOfStampPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickOKButtonOfAddTextStampWnd($TestCaseID, $sLogFileName1)
	If WinExists($sAddTextStampWnd) Then
		Common_SleepInSeconds(0.5)
		ControlClick($sAddTextStampWnd, '', 1)  ;OK button
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickOKButtonOfAddTextStampWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickOKButtonOfAddImageStampWnd($TestCaseID, $sLogFileName1)
	If WinExists($sAddImageStampWnd) Then
		Common_SleepInSeconds(0.5)
		ControlClick($sAddImageStampWnd, '', 1)  ;OK button
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickOKButtonOfAddImageStampWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickOKButtonOfModifyImageStampWnd($TestCaseID, $sLogFileName1)
	If WinExists($sModifyImageStampWnd) Then
		Common_SleepInSeconds(0.5)
		ControlClick($sModifyImageStampWnd, '', 1)  ;OK button
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickOKButtonOfModifyImageStampWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickOKButtonOfModifyTextStampWnd($TestCaseID, $sLogFileName1)
	If WinExists($sModifyTextStampWnd) Then
		Common_SleepInSeconds(0.5)
		ControlClick($sModifyTextStampWnd, '', 1)  ;OK button
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickOKButtonOfModifyTextStampWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc


Func ChangeTextStampFont($TestCaseID, $sLogFileName1)
	Local $sTitle = 'Font'
	ControlClick($sAddTextStampWnd, '', 2086)   ;font button
	If WinWait($sTitle, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sTitle)
		ChangeTextFont($sTitle)
		ControlClick($sTitle, '', 1) 
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeTextStampFont($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ModifyTextStampName($sName, $TestCaseID, $sLogFileName1)
	If WinWait($sModifyTextStampWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sModifyTextStampWnd)
		ControlSend($sModifyTextStampWnd, '', 2082, $sName)
		ControlFocus($sModifyTextStampWnd, '', 1)
		Common_SleepInSeconds(5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ModifyTestStampName($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False			
EndFunc

Func ModifyImageStampName($sName, $TestCaseID, $sLogFileName1)
	If WinWait($sModifyImageStampWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sModifyImageStampWnd)
		ControlSend($sModifyImageStampWnd, '', 2082, $sName)
		ControlFocus($sModifyImageStampWnd, '', 1)
		Common_SleepInSeconds(5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ModifyImageStampName($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False			
EndFunc

Func ModifyTextStampText($sName, $TestCaseID, $sLogFileName1)
	If WinWait($sModifyTextStampWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sModifyTextStampWnd)
		ControlSend($sModifyTextStampWnd, '', 2080, $sName)
		ControlFocus($sModifyTextStampWnd, '', 1)
		Common_SleepInSeconds(5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ModifyTextStampText($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False			
EndFunc

Func ModifyImageStampImage($sFileType, $TestCaseID, $sLogFileName1)
	Local $sText = 'File &name:'
	If Not OpenStamProPertiesWnd($TestCaseID, $sLogFileName1) Then Return False
	If WinGetHandle($sModifyImageStampWnd) == '' Then ControlClick($sStampsPrpertisWnd, '', 2088)
	If WinWait($sModifyImageStampWnd, '', 10) Then
		Common_SleepInSeconds(1)
		ControlClick($sModifyImageStampWnd, '', 2150)   ;Browse button
		If WinWait($sAddImageStampWnd, $sText, 10)  Then
			Common_SleepInSeconds(1)
			WinActivate($sAddImageStampWnd)
			If $sFileType == 'BMP' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'BMP.bmp')
			ElseIf $sFileType == 'PCX' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'PCX.pcx')
			ElseIf $sFileType == 'TIF' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'M-TIFF-Single page.tif')
			ElseIf $sFileType == 'JPEG' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'JPEG.jpg')
			ElseIf $sFileType == 'PCT' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'PCT.pct')
			ElseIf $sFileType == 'TGA' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'TGA.tga')
			ElseIf $sFileType == 'PNG' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'PNG.png')	
			ElseIf $sFileType == 'PCD' Then
				ControlSetText($sAddImageStampWnd, $sText, 1148, $sSampleFolderPath & 'PCD.pcd')					
			EndIf
			Common_SleepInSeconds(0.6)
			ControlClick($sAddImageStampWnd, $sText, 1)   ;Open button
			Common_SleepInSeconds(2)
			ControlFocus($sModifyImageStampWnd, '', 2160)
			Common_SleepInSeconds(1)
			Return True
		Else
		Common_WriteLog($sFaile & 'ModifyImageStampImage($sFileType, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
		Common_ClosePMWhenException()
		Return False
		EndIf	
	EndIf	
EndFunc

Func OpenStampPropertiesDlgFromImageMenu($TestCaseID, $sLogFileName1)
	Send('!i')
	Common_SleepInSeconds(0.5)
	For $i = 0 to 6
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)
	Next
	Send('{RIGHT}')
	Common_SleepInSeconds(0.5)
	Send('{UP}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	If WinWait($sStampsPrpertisWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sStampsPrpertisWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'OpenStampPropertiesDlgFromImageMenu($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickHighlighterButtonAnnotationBar()
	MouseClick('left', 1244, 216)
	Common_SleepInSeconds(0.5)
EndFunc

Func HighLightAreaInPageViewer()
	MouseClickDrag('left', 475, 207, 852, 294)
	Common_SleepInSeconds(1)
EndFunc

Func ClickDownArrowButtonOfHighlighterButtonAnnotationBar($TestCaseID, $sLogFileName1)
	MouseClick('left', 1262, 214)
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	If WinWait($sColorWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sColorWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDownArrowButtonOfHighlighterButtonAnnotationBar($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickDownArroeButtonOfStickyNoteBttonToOpenWnd($TestCaseID, $sLogFileName1, $sWnd)
	MouseClick('left', 1172, 251)
	Common_SleepInSeconds(0.5)	
	If $sWnd == 'Font' Then
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)	
		Send('{ENTER}')
		Common_SleepInSeconds(1)	
		If WinWait($sFontWnd, '', 5) Then
			WinActivate($sFontWnd)
			Return True
		EndIf
	ElseIf $sWnd == 'BackGround' Then
		Send('{UP}')
		Common_SleepInSeconds(0.2)	
		Send('{ENTER}')
		Common_SleepInSeconds(1)	
		If WinWait($sColorWnd, '', 5) Then
			WinActivate($sColorWnd)
			Return True
		EndIf
	EndIf	
	Common_WriteLog($sFaile & 'ClickDownArroeButtonOfStickyNoteBttonToOpenWnd($TestCaseID, $sLogFileName1, $sWnd)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SelectAnColorOfColorWnd($TestCaseID, $sLogFileName1, $sButton)
	If WinExists($sColorWnd) Then
		WinActivate($sColorWnd)
		MouseClick('left',651, 471)
		Common_SleepInSeconds(0.2)
		If $sButton == 'OK' Then
			ControlClick($sColorWnd, '', 1)   ;OK button
		ElseIf $sButton == 'Cancel' Then
			ControlClick($sColorWnd, '', 2)   ;Cancel button
		EndIf
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectAnColorOfColorWnd($TestCaseID, $sLogFileName1, $sButton)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SelectAnColorOfColorWndForPDFView($TestCaseID, $sLogFileName1, $sButton)
	If WinExists($sColorWnd) Then
		WinActivate($sColorWnd)
		MouseClick('left',539, 470)
		Common_SleepInSeconds(0.4)
		If $sButton == 'OK' Then
			ControlClick($sColorWnd, '', 1)   ;OK button
		ElseIf $sButton == 'Cancel' Then
			ControlClick($sColorWnd, '', 2)   ;Cancel button
		EndIf
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectAnColorOfColorWndForPDFView($TestCaseID, $sLogFileName1, $sButton)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickNoFillInBtnInTextPropertiesWnd($sWndTitle)
	ControlClick($sWndTitle, '', 1055)   ;No fill in button
	Common_SleepInSeconds(0.5)
EndFunc

Func SelectAnColorOfColorWndForPDFView_Ex($TestCaseID, $sLogFileName1, $sButton, $sWndTitle)
	If WinExists($sWndTitle) Then
		WinActivate($sWndTitle)
		MouseClick('left',539, 470)
		Common_SleepInSeconds(0.4)
		If $sButton == 'OK' Then
			ControlClick($sColorWnd, '', 1)   ;OK button
		ElseIf $sButton == 'Cancel' Then
			ControlClick($sColorWnd, '', 2)   ;Cancel button
		EndIf
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & ' SelectAnColorOfColorWndForPDFView_Ex($TestCaseID, $sLogFileName1, $sButton, $sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func EnargeStickyNoteSize()
	MouseClick('left', 858, 412)
	Common_SleepInSeconds(1.5)
	MouseClickDrag('left', 858, 412, 910,470)
	Common_SleepInSeconds(0.5)
EndFunc

Func OpenColorWndFromImageMenu($TestCaseID, $sLogFileName1, $sType)
	Send('!i')
	Common_SleepInSeconds(0.5)
	If $sType == 'Highlighter' Then
		For $i = 0 to 5
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
	ElseIf $sType == 'FreeHand' Then
		For $i = 0 to 4
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
	ElseIf $sType == 'StraightLine' Then
		For $i = 0 to 3
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next		
	EndIf
	Send('{RIGHT}')
	Common_SleepInSeconds(0.5)
	Send('{UP}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	If WinWait($sColorWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sColorWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'OpenColorWndFromImageMenu($TestCaseID, $sLogFileName1, $sType)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickFreeHandButtonInPageviwer()
	MouseClick('left',1200, 214)
	Common_SleepInSeconds(0.3)
EndFunc

Func ClickStraightLineButtonInPageviwer()
	MouseClick('left',1153, 214)
	Common_SleepInSeconds(0.3)
EndFunc

Func AddFreeHandInPageViwer()
	ClickFreeHandButtonInPageviwer()
	MouseClickDrag('left', 455, 220,660, 734)
	Common_SleepInSeconds(0.2)
	MouseClick('left',873, 152)
	Common_SleepInSeconds(0.2)
EndFunc

Func AddStraightLineInPageViwer()
	ClickStraightLineButtonInPageviwer()
	MouseClickDrag('left', 799, 220,690, 774)
	Common_SleepInSeconds(0.2)
	MouseClick('left',899, 152)
	Common_SleepInSeconds(0.2)
EndFunc

Func ClickDownArrowButtonOfFreeHandBtnToOpenColorWnd($TestCaseID, $sLogFileName1)
	MouseClick('left', 1218, 214)
	Common_SleepInSeconds(0.5)
	Send('{UP}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	If WinWait($sColorWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sColorWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDownArrowButtonOfFreeHandButtonAnnotationBar($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func AddjustStraightLineStyle($TestCaseID, $sLogFileName1,$sStyle ,$sbtn)
	If WinWait($sLinePropertisWnd, '', 5) Then
		WinActivate($sLinePropertisWnd)
		Common_SleepInSeconds(0.2)
		ControlClick($sLinePropertisWnd, '', 2179)   ;style button
		If $sStyle == '->' Then
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		ElseIf $sStyle == '<-' Then
			For $i = 0 to 1
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)				
			Next
		ElseIf $sStyle == '<->' Then
			For $i = 0 to 2
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)				
			Next
		EndIf
		Send('{ENTER}')
		Common_SleepInSeconds(0.4)	
		If $sbtn == 'OK' Then	
			ControlClick($sLinePropertisWnd, '', 1)   ;OK button
		ElseIf $sbtn == 'Cancel' Then	
			ControlClick($sLinePropertisWnd, '', 2)   ;Cancel button
		EndIf
		Common_SleepInSeconds(0.4)	
		Return True
	EndIf
	Common_WriteLog($sFaile & ' AddjustStraightLineStyle($TestCaseID, $sLogFileName1,$sStyle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickDownArrowButtonOfStraightLineBtnToOpenColorWnd($TestCaseID, $sLogFileName1)
	MouseClick('left', 1173, 214)
	Common_SleepInSeconds(0.5)
	Send('{UP}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	If WinWait($sColorWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sColorWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDownArrowButtonOfStraightLineBtnToOpenColorWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickDownArrowButtonOfFreeHandBtnToOpenLinePropertiesWnd($TestCaseID, $sLogFileName1)
	MouseClick('left', 1218, 214)
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	If WinWait($sLinePropertisWnd, '', 10) Then
		Common_SleepInSeconds(1)
		ControlFocus($sLinePropertisWnd, '', 'Button3')
		WinActivate($sLinePropertisWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDownArrowButtonOfFreeHandBtnToOpenLinePropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickDownArrowButtonOfStraightLineBtnToOpenLinePropertiesWnd($TestCaseID, $sLogFileName1)
	MouseClick('left', 1173, 214)
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	If WinWait($sLinePropertisWnd, '', 10) Then
		Common_SleepInSeconds(1)
		ControlFocus($sLinePropertisWnd, '', 'Button3')
		WinActivate($sLinePropertisWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDownArrowButtonOfFreeHandBtnToOpenLinePropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func AddJustLineAnnotationThinnerOrThicker($TestCaseID, $sLogFileName1, $sBtn, $sSzie)
	If WinExists($sLinePropertisWnd) Then
		ControlFocus($sLinePropertisWnd, '', 2199)
		Common_SleepInSeconds(0.2)
		If $sSzie == 'Thinner' Then
			For $i = 0 to 2
				Send('{LEFT}')
				Common_SleepInSeconds(0.2)
			Next
		ElseIf $sSzie == 'Normal' Then
			For $i = 0 to 7
				Send('{RIGHT}')
				Common_SleepInSeconds(0.2)
			Next
		ElseIf $sSzie == 'Thicker' Then
			For $i = 0 to 19
				Send('{RIGHT}')
				Common_SleepInSeconds(0.2)
			Next
		EndIf
		If $sBtn == 'OK' Then
			ControlClick($sLinePropertisWnd, '', 1)   ;OK button
		ElseIf $sBtn == 'Cancel' Then
			ControlClick($sLinePropertisWnd, '', 2)   ;Cancel button
		EndIf
		Common_SleepInSeconds(0.3)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'AddJustLineAnnotationThinnerOrThicker($TestCaseID, $sLogFileName1, $sBtn)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func OpenLinePropertiesWndFromMenu($TestCaseID, $sLogFileName1, $sType)
	Send('!i')
	Common_SleepInSeconds(0.5)
	If $sType == 'Highlighter' Then
		For $i = 0 to 5
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
	ElseIf $sType == 'FreeHand' Then
		For $i = 0 to 4
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
	ElseIf $sType == 'StraightLine' Then
		For $i = 0 to 3
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next		
	EndIf
	Send('{RIGHT}')
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	If WinWait($sLinePropertisWnd, '', 10) Then
		Common_SleepInSeconds(1)
		WinActivate($sLinePropertisWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'OpenLinePropertiesWndFromMenu($TestCaseID, $sLogFileName1, $sType)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectDeleteOptonOfContextMenu()
	For $i = 0 to 3
		Send('{UP}')
		Common_SleepInSeconds(0.2)
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func SelectDeleteOptonOfPDFContextMenu()
	;Select properties
	For $i = 0 To 6
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(1)
EndFunc

Func ClickAddedTextAnonotationInPageViewer()
	MouseClick('left', 630, 368)
	Common_SleepInSeconds(0.3)
EndFunc

Func OpenMenu($sName)
	If $sName = 'Edit' Then
		Send('!e')
		Common_SleepInSeconds(0.5)
	EndIf	
EndFunc

Func CutPasteINEditMenu()
	OpenMenu('Edit')
	Send('u')   ;cut
	Common_SleepInSeconds(0.3)
	OpenMenu('Edit')
	Send('a')	;paste
	Common_SleepInSeconds(0.2)
	MouseClick('left', 640, 378)
	Common_SleepInSeconds(0.5)
EndFunc

Func CopyPasteInEditMenu()
	OpenMenu('Edit')
	Send('c')   ;copy
	Common_SleepInSeconds(0.3)
	OpenMenu('Edit')
	Send('a')	;paste
	Common_SleepInSeconds(0.2)
	MouseClick('left', 578, 250)
	Common_SleepInSeconds(0.5)
EndFunc

Func DelectDeleteInEditMenu()
	OpenMenu('Edit')
	Send('c')   ;copy
	Common_SleepInSeconds(0.3)
	OpenMenu('Edit')
	Send('d')	;Delete
	Common_SleepInSeconds(0.2)
	MouseClick('left', 483, 209)
	Common_SleepInSeconds(0.5)
EndFunc

Func CopyPasteThenRedoUndoInEditMenu()
	OpenMenu('Edit')
	Send('c')   ;copy
	Common_SleepInSeconds(0.3)
	OpenMenu('Edit')
	Send('a')	;paste
	Common_SleepInSeconds(0.2)
	OpenMenu('Edit')
	Send('o')	;undo
	Common_SleepInSeconds(0.2)
	OpenMenu('Edit')
	Send('e')	;redo
	Common_SleepInSeconds(0.2)	
	MouseClick('left', 483, 209)
	Common_SleepInSeconds(0.5)
EndFunc

Func SelectCopyInContextMenu()
	Common_SleepInSeconds(0.5)
	For $i = 0 to 4
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func SelectCutInContextMenu()
	Common_SleepInSeconds(0.5)
	For $i = 0 to 3
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func SelectPasteInContextMenu()
	Common_SleepInSeconds(0.5)
	For $i = 0 to 5
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func SelectAnAreaInOCRJPGPageViewerToDoOCR()
	MouseClickDrag('left',348, 197, 832, 218)
	Common_SleepInSeconds(1)
EndFunc

Func ClickOCRMenuFromToolsMenu()
	Send('!t')
	Common_SleepInSeconds(0.5)
	Send('o')
	Common_SleepInSeconds(20)
EndFunc

Func SelectOCRFromContextMenu()
	For $i = 0 to 2
		Send('{UP}')
		Common_SleepInSeconds(0.2)
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)	
EndFunc

Func ClickEraserButtonInPageviewer()
	MouseClick('left',1109, 316)
	Common_SleepInSeconds(0.5)	
EndFunc

Func UseEraserInPageviewer()
	ClickEraserButtonInPageviewer()
	MouseClickDrag('left',479, 260, 749, 734)
	Common_SleepInSeconds(1)	
EndFunc

Func ClickDownArrowButtonOfEraserButtonToOpenEraserPropertiesWnd($TestCaseID, $sLogFileName1)
	MouseClick('left',1128, 312)
	Send('{DOWN}')
	Common_SleepInSeconds(0.2)	
	Send('{ENTER}')
	If WinWait($sEraserSettingsWnd, '', 5) Then
		WinActivate($sEraserSettingsWnd)
		Common_SleepInSeconds(1)	
		Return True
	EndIf
	Common_WriteLog($sFaile & ' ClickDownArrowButtonOfEraserButtonToOpenEraserPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func AddjustEraserSize($TestCaseID, $sLogFileName1,$size)
	If WinExists($sEraserSettingsWnd) Then
		If $size == 'Thin' Then
			ControlFocus($sEraserSettingsWnd, '', 1000)
			Common_SleepInSeconds(0.5)
			For $i = 0 to 11
				Send('{LEFT}')
				Common_SleepInSeconds(0.1)
			Next
		ElseIf  $size == 'Crude' Then 
			For $i = 0 to 71
				Send('{Right}')
				Common_SleepInSeconds(0.1)
			Next
		EndIf
		Send('{ENTER}')
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'AddjustEraserSize($TestCaseID, $sLogFileName1,$size)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ChangeEraserColor($TestCaseID, $sLogFileName1)
	If WinExists($sEraserSettingsWnd) Then
		MouseClick('left', 1259, 217)  ;green color button
		Common_SleepInSeconds(0.5)
		Send('{ENTER}')
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeEraserColor($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickSuctionButtonInErasettingWnd($TestCaseID, $sLogFileName1)
	If WinExists($sEraserSettingsWnd) Then
		MouseClick('left', 1032, 219) 
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickSuctionButtonInErasettingWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectEraserFromImageMenu()
	Send('!i')
	Common_SleepInSeconds(0.5)
	Send('e')
	Common_SleepInSeconds(0.5)
	Send('u')
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickCropButtonInPageviewer()
	MouseClick('left', 1153, 315)
	Common_SleepInSeconds(0.5)
EndFunc

Func CropAnAreaInPageviewer()
	ClickCropButtonInPageviewer()
	CutAreaInPageViewer() 
EndFunc

Func CutAreaInPageViewer()
	MouseClickDrag('left',383, 220, 888, 567)
	Common_SleepInSeconds(0.5)	 
	MouseClick('left', 410, 250)
	Common_SleepInSeconds(1)
EndFunc

Func CropAnAreaInPageviewerFromMenu()
	Send('!i')
	Common_SleepInSeconds(0.5)
	Send('c')
	Common_SleepInSeconds(0.5)
	CutAreaInPageViewer()
EndFunc

Func ClickInvertBtnInPageviewer()
	MouseClick('left', 1100, 421)
	Common_SleepInSeconds(1.5)
EndFunc

Func ClickAutomaticImageEnhancementBtnInPageviewer()
	MouseClick('left', 1146, 415)
	Common_SleepInSeconds(1.5)
EndFunc

Func ClickSetBrightnessAndContrastBtnInPageviewer($TestCaseID, $sLogFileName1)
	MouseClick('left',1183, 417)
	If WinWait($sSetBrightnessAndContrastWnd, '', 5) Then
		WinActivate($sSetBrightnessAndContrastWnd)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickSetBrightnessAndContrastBtnInPageviewer($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickOKOrCancelBtnSetBrightnessAndContrastBtnInPageviewer($TestCaseID, $sLogFileName1,$sBtn)
	If WinWait($sSetBrightnessAndContrastWnd, '', 5) Then
		WinActivate($sSetBrightnessAndContrastWnd)
		If $sBtn == 'OK' Then
			ControlClick($sSetBrightnessAndContrastWnd, '', 1)
		ElseIf $sBtn == 'Cancel' Then
			ControlClick($sSetBrightnessAndContrastWnd, '', 2)
		EndIf	
			Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickSetBrightnessAndContrastBtnInPageviewer($TestCaseID, $sLogFileName1,$sBtn)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SetContrastBrightnessInPageViewer($TestCaseID, $sLogFileName1,$sContrast,$sBrightness)
	If WinWait($sSetBrightnessAndContrastWnd, '', 5) Then
		WinActivate($sSetBrightnessAndContrastWnd)
		ControlSetText($sSetBrightnessAndContrastWnd, '', 2310,$sContrast)
		Common_SleepInSeconds(0.3)
		ControlSetText($sSetBrightnessAndContrastWnd, '', 2313,$sBrightness)
		Common_SleepInSeconds(0.3)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ContrastBrightnessInPageViewer($TestCaseID, $sLogFileName1,$sContrast,$sBrightness)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickZommInOrZommOutInContrastBrightnessSettingWnd($TestCaseID, $sLogFileName1,$sType,$sClickedTimes)
	If WinWait($sSetBrightnessAndContrastWnd, '', 5) Then
		WinActivate($sSetBrightnessAndContrastWnd)
		Local $iID
		If $sType = 'ZoomIn' Then
			$iID = 1000
		ElseIf $sType = 'ZoomOut' Then
			$iID = 1001
		EndIf	
		For $i = 1 to $sClickedTimes
			ControlClick($sSetBrightnessAndContrastWnd, '', $iID)
			Common_SleepInSeconds(0.3)
		Next
		Common_SleepInSeconds(0.7)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickZommInOrZommOutInContrastBrightnessSettingWnd($TestCaseID, $sLogFileName1,$sType,$sClickedTimes)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickColorAdjustmentBtnInPageviewer($TestCaseID, $sLogFileName1)
	MouseClick('left', 1222, 416)
	If WinWait($sColorAdjustmentWnd, '', 5) Then
		WinActivate($sColorAdjustmentWnd)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickColorAdjustmentBtnInPageviewer($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickOkOrCancelBtnInColorAdjustmentWnd($TestCaseID, $sLogFileName1,$sBtn)
	If WinWait($sColorAdjustmentWnd, '', 5) Then
		WinActivate($sColorAdjustmentWnd)
		If $sBtn == 'OK' Then
			ControlClick($sColorAdjustmentWnd,'',1)
		ElseIf $sBtn == 'Cancel' Then
			ControlClick($sColorAdjustmentWnd,'',2)
		EndIf	
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & ' ClickOkOrCancelBtnInColorAdjustmentWnd($TestCaseID, $sLogFileName1,$sBtn)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectColorInColorSettingWnd($TestCaseID, $sLogFileName1)
	If WinWait($sColorAdjustmentWnd, '', 5) Then
		MouseClick('left',797, 496)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectColorInColorSettingWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickZommInOrZommOutInColorSettingSettingWnd($TestCaseID, $sLogFileName1,$sType,$sClickedTimes)
	If WinWait($sColorAdjustmentWnd, '', 5) Then
		WinActivate($sColorAdjustmentWnd)
		Local $iID
		If $sType = 'ZoomIn' Then
			$iID = 1000
		ElseIf $sType = 'ZoomOut' Then
			$iID = 1001
		EndIf	
		For $i = 1 to $sClickedTimes
			ControlClick($sColorAdjustmentWnd, '', $iID)
			Common_SleepInSeconds(0.3)
		Next
		Common_SleepInSeconds(0.7)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickZommInOrZommOutInColorSettingSettingWnd($TestCaseID, $sLogFileName1,$sType,$sClickedTimes)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickRemoveNoiseBtnInPageviewer()
	For $i = 0 to 9
		MouseClick('left',1106, 453)
		Common_SleepInSeconds(0.2)
	Next
	Common_SleepInSeconds(3)
EndFunc

Func ClickImageHorizontallyBtnInPageviewer()
	MouseClick('left',1190, 316)
	Common_SleepInSeconds(1)
EndFunc

Func ClickImageVerticallyBtnInPageviewer()
	MouseClick('left',1228, 314)
	Common_SleepInSeconds(1)
EndFunc

Func OpenImageMenu()
	Send('!i')
	Common_SleepInSeconds(0.5)
EndFunc

Func OpenFileMenu()
	Send('!f')
	Common_SleepInSeconds(0.5)
EndFunc

Func DeskewinPageviwer()
	MouseClickDrag('left', 753, 537, 738, 624)
	Common_SleepInSeconds(0.5)
	MouseClick('left',654, 572)
	Common_SleepInSeconds(1)
EndFunc

Func DeskewinPageviwer_()
	MouseClickDrag('left', 753, 537, 738, 624)
	Common_SleepInSeconds(1)	
EndFunc

Func ClickDeskewToolBtnInpageViewer()
	MouseClick('left',1105, 350)
	Common_SleepInSeconds(1)	
EndFunc

Func ClickMouseButtonInPageviwerView($sBtn)
	If $sBtn == 'right' Then
		MouseClick($sBtn, 610, 366)
	ElseIf $sBtn == 'left' Then
		MouseClick($sBtn, 610, 366)
	EndIf
	Common_SleepInSeconds(1)
EndFunc

Func SelectSaveOptionInContextMenu()
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)
	Send('{ENTER}')
	Common_SleepInSeconds(1)
EndFunc

Func SelectSaveAsOptionInContextMenu($TestCaseID, $sLogFileName1)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)	
	Send('{ENTER}')
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectSaveAsOptionInContextMenu($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickSeetingBtnInSaveAsWnd($TestCaseID, $sLogFileName1)
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		ControlClick($sCommonWndClass, $sSaveAsWndText, 1020)   ; setting button
		If WinWait($sSettingsWnd, '', 5) Then
			WinActivate($sSettingsWnd)
			Common_SleepInSeconds(1)
			Return True
		EndIf
	EndIf
	Common_WriteLog($sFaile & 'ClickSeetingBtnInSaveAsWnd($TestCaseID, $sLogFileName1, $sBtn)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectSaveAsOptionFromFileMenu($TestCaseID, $sLogFileName1)
	OpenFileMenu()
	Send('s')
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectSaveAsOptionFromFileMenu($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func CLickOkOrCancelBtnInSaveAsWnd($TestCaseID, $sLogFileName1, $sBtn)
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		If $sBtn == 'OK' Then
			ControlClick($sCommonWndClass, $sSaveAsWndText,'Button2') ;save
			Common_SleepInSeconds(2)
		ElseIf $sBtn == 'Cancel' Then
			ControlClick($sCommonWndClass, $sSaveAsWndText,2) ;cancel
		EndIf
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'CLickOkOrCancelBtnInSaveAsWnd($TestCaseID, $sLogFileName1, $sBtn)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func CLickOkOrCancelBtnInSaveAsWnd_EX($TestCaseID, $sLogFileName1, $sBtn, $sSaveAsTime = 1)
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		If $sBtn == 'OK' Then
			ControlClick($sCommonWndClass, $sSaveAsWndText,'Button2') ;save
			Common_SleepInSeconds($sSaveAsTime)
		ElseIf $sBtn == 'Cancel' Then
			ControlClick($sCommonWndClass, $sSaveAsWndText,2) ;cancel
		EndIf
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'CLickOkOrCancelBtnInSaveAsWnd($TestCaseID, $sLogFileName1, $sBtn, $sSaveAsTime)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SetSaveAsFileName($TestCaseID, $sLogFileName1, $sName)
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		ControlSetText($sCommonWndClass, $sSaveAsWndText,1148, $sName)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetSaveAsFileName($TestCaseID, $sLogFileName1, $sName)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectSttingsInSaveAsSettingWnd($TestCaseID, $sLogFileName1, $sSettings)
	If WinWait($sSettingsWnd, '', 5) Then
		WinActivate($sSettingsWnd)
		If $sSettings == 'SaveAll' Then
			ControlClick($sSettingsWnd, '',1023)  
		ElseIf $sSettings == 'OnlyInPM' Then
			ControlClick($sSettingsWnd, '',1024)  
		ElseIf $sSettings == 'DontSave' Then
			ControlClick($sSettingsWnd, '',1025)  
		EndIf	
		Common_SleepInSeconds(0.5)
		ControlClick($sSettingsWnd, '',1)  
		Return True	
	EndIf
	Common_WriteLog($sFaile & 'SelectSttingsInSaveAsSettingWnd($TestCaseID, $sLogFileName1, $sBtn)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectDPISttingsInSaveAsSettingWnd($TestCaseID, $sLogFileName1, $sSettings)
	If WinWait($sSaveAsImage, '', 5) Then
		WinActivate($sSaveAsImage)
		ControlClick($sSaveAsImage, '','ComboBox1')  
		Common_SleepInSeconds(0.5)
		If $sSettings == '200DPI' Then
		ElseIf $sSettings == '96DPI' Then
			Send('{UP}') 
		ElseIf $sSettings == '300DPI' Then
			Send('{DOWN}') 
		EndIf	
		Common_SleepInSeconds(0.2)
		Send('{ENTER}')
		Common_SleepInSeconds(0.4)
		ControlClick($sSaveAsImage, '',1)  
		Return True	
	EndIf
	Common_WriteLog($sFaile & 'SelectDPISttingsInSaveAsSettingWnd($TestCaseID, $sLogFileName1, $sBtn)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickSaveAsButtonInPageViewer($TestCaseID, $sLogFileName1)
	MouseClick('left',81, 61)
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickSaveAsButtonInPageViewer($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func OpenMergePDFDlgFromToolsMenu($TestCaseID, $sLogFileName1)
	Send('!t')
	Common_SleepInSeconds(0.5)
	Send('m')
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'OpenMergePDFDlgFromToolsMenu($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickPrintBtnInPageviewer($TestCaseID, $sLogFileName1)
	MouseClick('left',125, 59)
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickPrintBtnInPageviewer($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SendPasswordForProtectPDF($TestCaseID, $sLogFileName1, $sPassword, $btn)
	If WinWait($sPasswordWnd, '', 5) Then
		WinActivate($sPasswordWnd)
		Common_SleepInSeconds(1)
		ControlSetText($sPasswordWnd, '', 1003, $sPassword)
		Common_SleepInSeconds(0.3)
		If $btn == 'OK' Then
			ControlClick($sPasswordWnd, '', 1)
		ElseIf $btn == 'OK'Then
			ControlClick($sPasswordWnd, '', 2)
		EndIf	
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SendPasswordForProtectPDF($TestCaseID, $sLogFileName1, $sPassword, $btn)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SelectFileInThumnailThenSwitchToPageviewer($hThumbnailView, $iFile, $hPMHandle)
	_GUICtrlListView_ClickItem($hThumbnailView, $iFile, "left") 
	Common_SleepInSeconds(0.3)
	ControlClick($hPMHandle, "", $sPageViewButtonInToolbarCtrInfo)
EndFunc

Func SwitchPageviewerFromContextMenu($hThumbnailView, $iFile)
	_GUICtrlListView_ClickItem($hThumbnailView, $iFile, "right") 
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)
	Send('{RIGHT}')
	Common_SleepInSeconds(0.3)
	Send('{ENTER}')
	Common_SleepInSeconds(0.3)
EndFunc

Func ClickNextPageBtnInPageviewer()
	MouseClick('left',467,64)
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickPreviousPageBtnInPageviewer()
	MouseClick('left', 375,64)
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickFitToWidthButtonInPageviewer()
	MouseClick('left', 973,1007)   ; fit to width button.
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickFitToPageButtonInPageviewer()
	MouseClick('left', 949,1007)   ; fit to page button.
	Common_SleepInSeconds(0.5)
EndFunc

Func ShowTaskPaneInViewMenu()
	Send('!v')
	Common_SleepInSeconds(0.5)
	Send('{UP}')
	Common_SleepInSeconds(0.5)
	Send('{ENTER}')    ;show editing tools
	Common_SleepInSeconds(2)	
EndFunc

Func HideTaskPaneInPageviewer()
	MouseClick('left',1250, 94)   ; Auto hide button
	Common_SleepInSeconds(2)
EndFunc

Func ClickXButtonOnTaskPaneInPageviewer()
	MouseClick('left',1267, 94)   ; X button
	Common_SleepInSeconds(1)
EndFunc

Func ClickOCRViewXButtonOnTaskPaneInPageviewer()
	MouseClick('left',1270, 7)   ; X button
	Common_SleepInSeconds(1)
EndFunc

Func AutoHideTaskPane()
	For $i = 0 to 1
		Send('{UP}')
		Common_SleepInSeconds(0.2)   ;Auto hide
	Next
	Send('{ENTER}')
	Common_SleepInSeconds(1)
EndFunc

Func ClickDownArrowBtnToOpenTextBoxPropertiesWnd($TestCaseID, $sLogFileName1)
	MouseClick('left',1128, 213)
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)
	Send('{ENTER}')   
	If WinWait($sTextBoxPropertiesWnd, '', 5) Then
		WinActivate($sTextBoxPropertiesWnd)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDownArrowBtnToOpenTextBoxPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ChangeTextLineStyle($TestCaseID, $sLogFileName1, $sStyle)
	If WinWait($sTextBoxPropertiesWnd, '', 5) Then
		WinActivate($sTextBoxPropertiesWnd)
		ControlClick($sTextBoxPropertiesWnd, '', 'ComboBox1')
		Common_SleepInSeconds(1)
		If $sStyle == 'NOBORDER' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'Dot' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 1
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'DotLine' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 2
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'Dash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 3
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'DotDash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 4
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next		
		ElseIf $sStyle == 'ShortDot' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 5
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'LongDot' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 6
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'ShortSquiggly' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 7
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next		
		ElseIf $sStyle == 'LongSquiggly' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 8
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next				
		EndIf
		Common_SleepInSeconds(0.3)
		Send('{ENTER}')
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeTextLineStyle($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickOKOrCancleBtnOnTextBoxPropertiesWnd($TestCaseID, $sLogFileName1, $sBtn)
	If WinWait($sTextBoxPropertiesWnd, '', 5) Then
		WinActivate($sTextBoxPropertiesWnd)
		If $sBtn == 'OK' Then
			ControlClick($sTextBoxPropertiesWnd, '', 1)
		ElseIf $sBtn == 'Cancel' Then
			ControlClick($sTextBoxPropertiesWnd, '', 2)
		EndIf	
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickOKOrCancleBtnOnTextBoxPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func AddTextBoxForPDF($sText)
	MouseClick('left',1108, 212)
	Common_SleepInSeconds(0.5)
	MouseClickDrag('left',398, 236,584, 410)
	Common_SleepInSeconds(0.5)
	Send($sText)
	Common_SleepInSeconds(0.5)
	MouseClick('left',926, 881)
	Common_SleepInSeconds(1)
EndFunc

Func SetThickness($value, $TestCaseID, $sLogFileName1)
	If WinWait($sTextBoxPropertiesWnd, '', 5) Then
		ControlFocus($sTextBoxPropertiesWnd, '',1013)
		Common_SleepInSeconds(0.2)
		For $i = 0 To 3
			Send('{DEL}')
		Next	
		Common_SleepInSeconds(0.3)
		Send($value)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetThickness($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SetThickness_EX($value, $TestCaseID, $sLogFileName1,$sWndTitle)
	If WinWait($sWndTitle, '', 5) Then
		ControlFocus($sWndTitle, '',1013)
		Common_SleepInSeconds(0.2)
		For $i = 0 To 3
			Send('{DEL}')
		Next	
		Common_SleepInSeconds(0.3)
		Send($value)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetThickness_EX($value, $TestCaseID, $sLogFileName1,$sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ChangeTextBoxColor($TestCaseID, $sLogFileName1)
	If WinWait($sTextBoxPropertiesWnd, '', 5) Then
		ControlClick($sTextBoxPropertiesWnd, '', 1016)
		Common_SleepInSeconds(1)
		MouseClick('left',564, 543)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeTextBoxColor($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ChangeTextBoxColor_EX($TestCaseID, $sLogFileName1,$sWndTitle)
	If WinWait($sWndTitle, '', 5) Then
		ControlClick($sWndTitle, '', 1016)
		Common_SleepInSeconds(1)
		MouseClick('left',564, 543)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeTextBoxColor_EX($TestCaseID, $sLogFileName1,$sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SetOpacity($value, $TestCaseID, $sLogFileName1)
	If WinWait($sTextBoxPropertiesWnd, '', 5) Then
		ControlFocus($sTextBoxPropertiesWnd, '',1018)
		Common_SleepInSeconds(0.2)
		For $i = 0 To 3
			Send('{DEL}')
		Next	
		Common_SleepInSeconds(0.3)
		Send($value)
		Common_SleepInSeconds(1)
		Return True		
	EndIf
	Common_WriteLog($sFaile & 'SetOpacity($value, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SetOpacity_EX($value, $TestCaseID, $sLogFileName1,$sWntTitle)
	If WinWait($sWntTitle, '', 5) Then
		ControlFocus($sWntTitle, '',1018)
		Common_SleepInSeconds(0.2)
		For $i = 0 To 3
			Send('{DEL}')
		Next	
		Common_SleepInSeconds(0.3)
		Send($value)
		Common_SleepInSeconds(1)
		Return True		
	EndIf
	Common_WriteLog($sFaile & 'SetOpacity_EX($value, $TestCaseID, $sLogFileName1,$sWntTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickFillColorBtnInTextBoxPropertiesWnd($TestCaseID, $sLogFileName1)
	If WinWait($sTextBoxPropertiesWnd, '', 5) Then
		ControlClick($sTextBoxPropertiesWnd, '', 1026)
		Common_SleepInSeconds(1)
		Return True		
	EndIf
	Common_WriteLog($sFaile & 'ClickFillColorBtnInTextBoxPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickFillColorBtnInTextPropertiesWnd($TestCaseID, $sLogFileName1,$sWndTitle)
	If WinWait($sWndTitle, '', 5) Then
		ControlClick($sWndTitle, '', 1026)
		Common_SleepInSeconds(1)
		Return True		
	EndIf
	Common_WriteLog($sFaile & 'ClickFillColorBtnInTextPropertiesWnd($TestCaseID, $sLogFileName1,$sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func RightClickAddedTextbox()
	MouseClick('right', 480, 314)
	Common_SleepInSeconds(1)	
EndFunc

Func RightClickAddedTextCallout()
	MouseClick('right', 441, 273)
	Common_SleepInSeconds(0.5)	
EndFunc

Func RightClickAddedStickNote()
	MouseClick('right', 442, 277)
	Common_SleepInSeconds(0.5)	
EndFunc

Func RightClickAddedStamp()
	MouseClick('right', 410, 271)
	Common_SleepInSeconds(0.5)	
EndFunc

Func OpenProperteisWndPDFViewContextMenu()
	;Select properties
	Send('{UP}')
	Common_SleepInSeconds(0.3)
	Send('{ENTER}')
	WinWait($sFilePropertiesWndTitle, '', 2)
	Common_SleepInSeconds(0.5)
	ControlFocus($sFilePropertiesWndTitle, '', 1032)
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickDownArrowBtnToOpenTextCalloutPropertiesWnd($TestCaseID, $sLogFileName1)
	MouseClick('left',1172, 213)
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)
	Send('{ENTER}')   
	If WinWait($sCalloutPropertiesWnd, '', 5) Then
		WinActivate($sCalloutPropertiesWnd)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDownArrowBtnToOpenTextCalloutPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickDownArrowBtnToOpenStickNotePropertiesWnd($TestCaseID, $sLogFileName1)
	MouseClick('left',1217, 214)
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)
	Send('{ENTER}')   
	If WinWait($sStickyNotePropertiesPropertiesWnd, '', 5) Then
		WinActivate($sStickyNotePropertiesPropertiesWnd)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickDownArrowBtnToOpenStickNotePropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ChangeTextLineStyle_Ex($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)
	If WinWait($sWndTitle, '', 5) Then
		WinActivate($sWndTitle)
		ControlClick($sWndTitle, '', 'ComboBox1')
		Common_SleepInSeconds(1)
		If $sStyle == 'NoFrame' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'Dot' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 1
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'DotLine' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 2
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'Dash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 3
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'DotDash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 4
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next		
		ElseIf $sStyle == 'ShortDot' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 5
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'LongDot' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 6
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'ShortSquiggly' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 7
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next		
		ElseIf $sStyle == 'LongSquiggly' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 8
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next				
		EndIf
		Common_SleepInSeconds(0.3)
		Send('{ENTER}')
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeTextLineStyle_Ex($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func AddTextCalloutForPDF($sText)
	MouseClick('left',1152, 212)
	Common_SleepInSeconds(0.5)
	MouseClick('left',448, 280)
	Common_SleepInSeconds(0.5)
	Send($sText)
	Common_SleepInSeconds(0.5)
	ClickSelectAnnotationButtonInPDFView()
	MouseClick('left',926, 881)
	Common_SleepInSeconds(1)
EndFunc

Func AddStickNoteForPDF()
	MouseClick('left',1196, 210)
	Common_SleepInSeconds(0.5)
	MouseClick('left',448, 280)
	Common_SleepInSeconds(0.5)
	ClickSelectAnnotationButtonInPDFView()
	MouseClick('left',926, 881)
	Common_SleepInSeconds(1)
EndFunc

Func ClickSelectAnnotationButtonInPDFView()
	MouseClick('left',1107, 145)
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickOKOrCancleBtnOnTextPropertiesWnd($TestCaseID, $sLogFileName1, $sBtn,$sWindTile)
	If WinWait($sWindTile, '', 5) Then
		WinActivate($sWindTile)
		If $sBtn == 'OK' Then
			ControlClick($sWindTile, '', 1)
		ElseIf $sBtn == 'Cancel' Then
			ControlClick($sWindTile, '', 2)
		EndIf	
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickOKOrCancleBtnOnTextPropertiesWnd($TestCaseID, $sLogFileName1, $sBtn,$sWindTile)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SetArrowsEndStyle($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)
	If WinWait($sWndTitle, '', 5) Then
		WinActivate($sWndTitle)
		ControlClick($sWndTitle, '', 'ComboBox3')
		Common_SleepInSeconds(1)
		If $sStyle == 'None' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
		ElseIf $sStyle == 'Open' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
			For $i = 0 to 0
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)  
			Next
		ElseIf $sStyle == 'Closed' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
			For $i = 0 to 1
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)  
			Next
		ElseIf $sStyle == 'Open(Reverse)' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
			For $i = 0 to 2
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)  
			Next	
		ElseIf $sStyle == 'Close(Reverse)' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
			For $i = 0 to 3
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)  
			Next		
		ElseIf $sStyle == 'Butt' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
			For $i = 0 to 4
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)  
			Next	
		ElseIf $sStyle == 'Diamond' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
			For $i = 0 to 5
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)  
			Next	
		ElseIf $sStyle == 'Round' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
			For $i = 0 to 6
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)  
			Next		
		ElseIf $sStyle == 'Square' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
			For $i = 0 to 7
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)  
			Next	
		ElseIf $sStyle == 'Slash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.1)  
			Next
			For $i = 0 to 8
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)  
			Next				
		EndIf
		Common_SleepInSeconds(0.3)
		Send('{ENTER}')
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeTextLineStyle_Ex($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SetIconStyle($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)
	If WinWait($sWndTitle, '', 5) Then
		WinActivate($sWndTitle)
		ControlClick($sWndTitle, '', 'ComboBox4')
		Common_SleepInSeconds(1)
		If $sStyle == 'Check' Then                     ;1
			Send('c')
			Common_SleepInSeconds(0.3) 
		ElseIf $sStyle == 'Cross' Then                 ;2
			For $i = 0 to 2
				Send('c')
				Common_SleepInSeconds(0.3) 
			Next
		ElseIf $sStyle == 'Comment' Then                ;3
			For $i = 0 to 1
				Send('c')
				Common_SleepInSeconds(0.3) 
			Next
		ElseIf $sStyle == 'Oval' Then           ;4
			Send('o')
			Common_SleepInSeconds(0.3)  
		ElseIf $sStyle == 'Help' Then   ;5
			Send('h')
			Common_SleepInSeconds(0.3) 	
		ElseIf $sStyle == 'Insert' Then     ;6
			Send('i')
			Common_SleepInSeconds(0.3) 
		ElseIf $sStyle == 'Key' Then    ;7
			Send('k')
			Common_SleepInSeconds(0.3) 
		ElseIf $sStyle == 'NewParagraph' Then    ;8
			Send('n')
			Common_SleepInSeconds(0.3) 	
		ElseIf $sStyle == 'Note' Then   ;9
			For $i = 0 to 1
				Send('n')
				Common_SleepInSeconds(0.3) 
			Next	
		ElseIf $sStyle == 'Paragraph' Then   ;10
			Send('p')
			Common_SleepInSeconds(0.3) 		
		ElseIf $sStyle == 'RightArrow' Then   ;11
			Send('r')
			Common_SleepInSeconds(0.3) 			
		ElseIf $sStyle == 'RightPoint' Then   ;12
			For $i = 0 to 1
				Send('r')
				Common_SleepInSeconds(0.3) 
			Next	
		ElseIf $sStyle == 'Start' Then   ;13
			Send('s')
			Common_SleepInSeconds(0.3) 		
		ElseIf $sStyle == 'UpArrow' Then   ;14
			Send('u')
			Common_SleepInSeconds(0.3) 		
		ElseIf $sStyle == 'UpLeftArrow' Then   ;15
			For $i = 0 to 1
				Send('u')
				Common_SleepInSeconds(0.3) 
			Next				
		EndIf
		Common_SleepInSeconds(0.2)
		Send('{ENTER}')
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetIconStyle($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func AddStampOnPDF($sStamp)
	MouseClick('left',1242, 213)
	Common_SleepInSeconds(0.8)
	If $sStamp == 'Draft' Or $sStamp == 'SBDraft' Then
		For $i = 0 To 3
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
	ElseIf $sStamp == 'SBApproved' Then
		Send('{DOWN}')
		Common_SleepInSeconds(0.2)
	ElseIf $sStamp == 'SBCompleted' Then
		For $i = 0 To 1
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
	ElseIf $sStamp == 'SBConfidential' Then
		For $i = 0 To 2
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next	
	ElseIf $sStamp == 'SBFinal' Then
		For $i = 0 To 4
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next	
	ElseIf $sStamp == 'SBForComment' Then
		For $i = 0 To 5
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next	
	ElseIf $sStamp == 'SBForPublicRelease' Then
		For $i = 0 To 6
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
	ElseIf $sStamp == 'SBInformationOnly' Then
		For $i = 0 To 7
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next	
	ElseIf $sStamp == 'SBNotApproved' Then
		For $i = 0 To 8
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
	ElseIf $sStamp == 'SBNotForPublicRelease' Then
		For $i = 0 To 9
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next	
	ElseIf $sStamp == 'SBPreliminaryResults' Then
		For $i = 0 To 10
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next
	ElseIf $sStamp == 'SBVoid' Then
		For $i = 0 To 11
			Send('{DOWN}')
			Common_SleepInSeconds(0.2)
		Next			
	EndIf
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
	MouseClick('left',400, 261)
	Common_SleepInSeconds(0.2)
	MouseClick('left',756, 748)
EndFunc

Func DoubleClickAddedStampOnPDFToOpenStampPropertiesWnd($TestCaseID, $sLogFileName1)
	MouseClick('left',400, 261,4)
	If WinWait($sStampPropertiesWnd, '', 5) Then
		WinActivate($sStampPropertiesWnd)
		Common_SleepInSeconds(0.2)
		ControlFocus($sStampPropertiesWnd, '', 1)
		Common_SleepInSeconds(0.8)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedStampOnPDFToOpenStampPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickTabInWindow($sWndTitle, $iTabOrfer, $iTabCtrl, $TestCaseID, $sLogFileName1)
	If WinWait($sWndTitle, '', 5) Then
		WinActivate($sWndTitle)
		Common_SleepInSeconds(0.2)
		_GUICtrlTab_ClickTab(ControlGetHandle($sWndTitle, '', $iTabCtrl), $iTabOrfer)
		Common_SleepInSeconds(1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickTabInWindow($sWndTitle, $iTabOrfer, $iTabCtrl, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ChangeGernalTabContent($sWndTitle, $TestCaseID, $sLogFileName1)
	If WinWait($sWndTitle, '', 5) Then
		WinActivate($sWndTitle)
		Common_SleepInSeconds(0.2)
		ControlSetText($sWndTitle, '', 1030, 'Test')
		Common_SleepInSeconds(0.2)
		ControlSetText($sWndTitle, '', 1029, 'Test')
		Common_SleepInSeconds(0.2)
		ControlSetText($sWndTitle, '', 1053, 'Test')
		Common_SleepInSeconds(0.8)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickTabInWindow($sWndTitle, $iTabOrfer, $iTabCtrl, $TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func AttachFileForPDF($TestCaseID, $sLogFileName1, $sFileName)
	MouseClick('left', 1108, 250)
	Common_SleepInSeconds(0.5)
	MouseClick('left', 385, 260)
	If WinWait($sOpenWnd, $sOpenWndText, 5) Then
		WinActivate($sOpenWnd, $sOpenWndText)
		Common_SleepInSeconds(0.5)
		ControlSetText($sOpenWnd, $sOpenWndText, 1148, $sFileName)   ;set file name
		Common_SleepInSeconds(0.3)
		ControlClick($sOpenWnd, $sOpenWndText, 1)   ;OK button
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'AttachFileForPDF($TestCaseID, $sLogFileName1, $sFileName)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickOKBtnInFileAttachmentPropertiesWnd($TestCaseID, $sLogFileName1)
	If WinWait($sFileAttachmentPropertiesWnd, '', 5) Then
		WinActivate($sFileAttachmentPropertiesWnd)
		Common_SleepInSeconds(0.5)
		ControlClick($sFileAttachmentPropertiesWnd, '', 1)   ;OK button
		Common_SleepInSeconds(0.2)
		MouseClick('left', 729, 760)
		Common_SleepInSeconds(0.6)
		Return True
	EndIf
	Common_WriteLog($sFaile & ' CLickOKBtnInFileAttachmentPropertiesWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ChangeAttachedFileIcon($TestCaseID, $sLogFileName1, $sIcon)
	If WinWait($sFileAttachmentPropertiesWnd, '', 5) Then
		Common_SleepInSeconds(0.2)
		ControlClick($sFileAttachmentPropertiesWnd, '', 'ComboBox4')    
		Common_SleepInSeconds(0.8)
		For $i = 0 to 2 
			Send('{UP}')
			Common_SleepInSeconds(0.1)
		Next
		If $sIcon == 'Graph' Then
		ElseIf $sIcon == 'Paperclip' Then
			For $i = 0 to 0
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)
			Next
		ElseIf $sIcon == 'PushPin' Then
			For $i = 0 to 1
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)
			Next	
		ElseIf $sIcon == 'Tag' Then
			For $i = 0 to 2
				Send('{DOWN}')
				Common_SleepInSeconds(0.1)
			Next			
		EndIf
		Send("{ENTER}")
		Common_SleepInSeconds(0.3)	
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeAttachedFileIcon($TestCaseID, $sLogFileName1, $sIcon)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func RightClickAddedFileAttached()
	MouseClick('right', 372, 259)
	Common_SleepInSeconds(0.5)	
EndFunc

Func ClickOKButtonOfWnd($TestCaseID, $sLogFileName1, $sWndTitle)
	If WinWait($sWndTitle, '', 5) Then
		WinActivate($sWndTitle)
		ControlClick($sWndTitle, '', 1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickOKButtonOfWnd($TestCaseID, $sLogFileName1, $sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func AddCaretInPDF()
	MouseClick('left',1104, 316)
	Common_SleepInSeconds(0.2)	
	MouseClick('left',914, 259)
	Common_SleepInSeconds(0.2)
	MouseClick('left',384, 246)	
	Common_SleepInSeconds(0.5)
EndFunc

Func DoubleClickAddedCaret($TestCaseID, $sLogFileName1)
	MouseClick('left', 920, 273, 3)
	If WinWait($sInsertCaretPropertiesWnd, '', 5) Then
		WinActivate($sInsertCaretPropertiesWnd)
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedCaret($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func RightClickAddedCaret()
	MouseClick('right', 920, 273)
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickAddStrikeOutBtn()
	MouseClick('left', 1151, 313)
	Common_SleepInSeconds(0.3)
EndFunc

Func ClickAddUnderlineBtn()
	MouseClick('left', 1196, 313)
	Common_SleepInSeconds(0.3)
EndFunc

Func ClickAddHighLightBtn()
	MouseClick('left', 1242, 315)
	Common_SleepInSeconds(0.3)
EndFunc

Func SelectSentenceToAddStrikeOut()
	MouseClickDrag('left', 586, 253, 967, 256)
	Common_SleepInSeconds(0.5)
EndFunc

Func DoubleClickAddedStrikeOut($TestCaseID, $sLogFileName1)
	MouseClick('left', 700, 253, 3)
	If WinWait($sCrossOutPropertiesWnd, '', 5) Then
		WinActivate($sCrossOutPropertiesWnd)
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedStrikeOut($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ChangeUnderLineStyle($TestCaseID, $sLogFileName1, $sStyle)
	If WinWait($sUnderlinePropertiesPropertiesWnd, '', 5) Then
		WinActivate($sUnderlinePropertiesPropertiesWnd)
		If $sStyle = 'straight' Then
		ElseIf $sStyle = 'squiggle' Then
			ControlClick($sUnderlinePropertiesPropertiesWnd, '', 'ComboBox1')
			Common_SleepInSeconds(0.5)
			Send('{DOWN}')
			Common_SleepInSeconds(0.1)
			Send('{ENTER}')
			Common_SleepInSeconds(0.3)
		EndIf	
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeUnderLineStyle($TestCaseID, $sLogFileName1, $sStyle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func DoubleClickAddedUnderline($TestCaseID, $sLogFileName1)
	MouseClick('left', 700, 253, 3)
	If WinWait($sUnderlinePropertiesPropertiesWnd, '', 5) Then
		WinActivate($sUnderlinePropertiesPropertiesWnd)
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedUnderline($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func DoubleClickAddedHighLight($TestCaseID, $sLogFileName1)
	MouseClick('left', 700, 253, 3)
	If WinWait($sHighlightPropertiesWnd, '', 5) Then
		WinActivate($sHighlightPropertiesWnd)
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedHighLight($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ChangeFocusOfStrikeOut()
	MouseClick('left', 499, 250)
	Common_SleepInSeconds(0.5)
EndFunc

Func RightClickAddedStrikeOut()
	MouseClick('right', 700, 253)
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickOvalBtn()
	MouseClick('left', 1107, 380)
	Common_SleepInSeconds(0.3)
EndFunc

Func AddOvalInPDF()
	ClickOvalBtn()
	MouseClick('left', 425, 207)
	Common_SleepInSeconds(0.2) 
	MouseClick('left', 583, 339)
	Common_SleepInSeconds(0.2) 
	MouseClick('left', 405, 779)
	Common_SleepInSeconds(0.5) 
EndFunc

Func ChangeFocus1()
	MouseClick('left', 405, 779)
	Common_SleepInSeconds(0.5)
EndFunc

Func DoubleClickAddedOval($TestCaseID, $sLogFileName1)
	MouseClick('left', 500, 290, 3)
	If WinWait($sOvalPropertiesWnd, '', 5) Then
		WinActivate($sOvalPropertiesWnd)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedOval($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ChangeLineStyle($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)
	If WinWait($sWndTitle, '', 5) Then
		WinActivate($sWndTitle)
		ControlClick($sWndTitle, '', 'ComboBox1')
		Common_SleepInSeconds(1)
		If $sStyle == 'Line' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'Dot' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 0
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'DotLine' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 1
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'Dash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 2
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'DotDash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 3
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next		
		ElseIf $sStyle == 'LongDotDash' Then  
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 4
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'ShortDotDash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 5
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'ShortSquiggly' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 6
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next		
		ElseIf $sStyle == 'LongSquiggly' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 7
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next				
		EndIf
		Common_SleepInSeconds(0.3)
		Send('{ENTER}')
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeLineStyle($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func MovedAddedOval()
	MouseClickDrag('left', 500, 290, 788, 875)
	Common_SleepInSeconds(0.3)
EndFunc

Func RightClickAddedOval()
	MouseClick('right', 500, 290)
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickRectangleBtn()
	MouseClick('left',1153, 379)
	Common_SleepInSeconds(0.3)
EndFunc

Func AddRectangleInPDF()
	ClickRectangleBtn()
	MouseClick('left', 425, 207)
	Common_SleepInSeconds(0.2) 
	MouseClick('left', 583, 339)
	Common_SleepInSeconds(0.2) 
	MouseClick('left', 405, 779)
	Common_SleepInSeconds(0.5) 
EndFunc

Func DoubleClickAddedRectangle($TestCaseID, $sLogFileName1)
	MouseClick('left', 500, 290, 3)
	If WinWait($sRectanglePropertiesWnd, '', 5) Then
		WinActivate($sRectanglePropertiesWnd)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedRectangle($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func AddLineInPDF()
	MouseClick('left',1198, 380)
	Common_SleepInSeconds(0.3) 
	MouseClick('left',416, 198)
	Common_SleepInSeconds(0.2) 
	MouseClick('left',706, 400)
EndFunc

Func DoubleClickAddedLine($TestCaseID, $sLogFileName1)
	MouseClick('left', 550, 292, 3)
	If WinWait($sLinePropertiesWnd, '', 5) Then
		WinActivate($sLinePropertiesWnd)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedLine($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ChangeLineStyle2($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)
	If WinWait($sWndTitle, '', 5) Then
		WinActivate($sWndTitle)
		ControlClick($sWndTitle, '', 'ComboBox1')
		Common_SleepInSeconds(1)
		If $sStyle == 'Line' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'Dot' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 0
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'DotLine' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 1
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next
		ElseIf $sStyle == 'Dash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 2
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'DotDash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 3
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next		
		ElseIf $sStyle == 'Short Dotted Dash' Then  
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 4
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'Long Dotted Dash' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 5
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next	
		ElseIf $sStyle == 'ShortSquiggly' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 6
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next		
		ElseIf $sStyle == 'LongSquiggly' Then
			For $i = 0 to 1
				Send('{UP}')
				Common_SleepInSeconds(0.2)  
			Next
			For $i = 0 to 7
				Send('{DOWN}')
				Common_SleepInSeconds(0.2)  
			Next				
		EndIf
		Common_SleepInSeconds(0.3)
		Send('{ENTER}')
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeLineStyle2($TestCaseID, $sLogFileName1, $sStyle, $sWndTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ChangeLineArrowStart($TestCaseID, $sLogFileName1)
	If WinWait($sLinePropertiesWnd, '', 5) Then
		WinWaitActive($sLinePropertiesWnd)
		ControlClick($sLinePropertiesWnd, '', 'ComboBox2')
		Common_SleepInSeconds(0.3)
		For $i = 0 to 3
			Send('{DOWN}')
			Common_SleepInSeconds(0.1)
		Next
		Send('{ENTER}')
		Common_SleepInSeconds(0.3)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeLineArrowStart($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ChangeLineArrowEnd($TestCaseID, $sLogFileName1)
	If WinWait($sLinePropertiesWnd, '', 5) Then
		WinWaitActive($sLinePropertiesWnd)
		ControlClick($sLinePropertiesWnd, '', 'ComboBox3')
		Common_SleepInSeconds(0.3)
		For $i = 0 to 3
			Send('{DOWN}')
			Common_SleepInSeconds(0.1)
		Next
		Send('{ENTER}')
		Common_SleepInSeconds(0.3)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeLineArrowEnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func MovedAddedLine()
	MouseClickDrag('left', 550, 292, $RIGHT_LOWER_CORNER_POSITION[0], $RIGHT_LOWER_CORNER_POSITION[1])
	Common_SleepInSeconds(0.3)
EndFunc

Func RightClickAddedLine()
	MouseClick('right', 550, 292)
	Common_SleepInSeconds(0.5)
EndFunc

Func AddPolygonInPDF()
	MouseClick('left',1242, 378)
	Common_SleepInSeconds(0.2) 
	MouseClick('left',364, 207)
	Common_SleepInSeconds(0.1) 
	MouseClick('left',546, 239)
	Common_SleepInSeconds(0.1) 
	MouseClick('left',457, 303)
	Common_SleepInSeconds(0.1) 
	MouseClick('left',385, 247)
	Common_SleepInSeconds(0.1) 
	Send('{ESC}')
	Common_SleepInSeconds(0.3)
EndFunc

Func AddPolygonInPDF_()
	MouseClick('left',364, 207)
	Common_SleepInSeconds(0.1) 
	MouseClick('left',546, 239)
	Common_SleepInSeconds(0.1) 
	MouseClick('left',457, 303)
	Common_SleepInSeconds(0.1) 
	MouseClick('left',385, 247)
	Common_SleepInSeconds(0.1) 
	Send('{ESC}')
EndFunc

Func DoubleClickAddedPolygon($TestCaseID, $sLogFileName1)
	MouseClick('left', 448, 250, 3)
	If WinWait($sPolygonPropertiesWnd, '', 5) Then
		WinActivate($sPolygonPropertiesWnd)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedPolygon($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func RightClickAddedPolygon()
	MouseClick('right', 448, 250, 3)
	Common_SleepInSeconds(0.5)
EndFunc

Func AddPolygonLinesInPDF()
	MouseClick('left',1107, 417)
	Common_SleepInSeconds(0.2) 
	MouseClick('left',364, 207)
	Common_SleepInSeconds(0.1) 
	MouseClick('left',546, 239)
	Common_SleepInSeconds(0.1) 
	MouseClick('left',457, 303)
	Common_SleepInSeconds(0.1) 
	MouseClick('left',385, 247)
	Common_SleepInSeconds(0.1) 
	Send('{ESC}')
	Common_SleepInSeconds(0.3)
EndFunc

Func DoubleClickAddedPolygonLines($TestCaseID, $sLogFileName1)
	MouseClick('left', 448, 250, 3)
	If WinWait($sPolygonLinePropertiesWnd, '', 5) Then
		WinActivate($sPolygonLinePropertiesWnd)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedPolygonLines($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ChangeLineArrowStart_Ex($TestCaseID, $sLogFileName1,$sWNdTitle)
	If WinWait($sWNdTitle, '', 5) Then
		WinWaitActive($sWNdTitle)
		ControlClick($sWNdTitle, '', 'ComboBox2')
		Common_SleepInSeconds(0.3)
		For $i = 0 to 3
			Send('{DOWN}')
			Common_SleepInSeconds(0.1)
		Next
		Send('{ENTER}')
		Common_SleepInSeconds(0.3)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeLineArrowStart_Ex($TestCaseID, $sLogFileName1,$sWNdTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ChangeLineArrowEnd_EX($TestCaseID, $sLogFileName1,$sWNdTitle)
	If WinWait($sWNdTitle, '', 5) Then
		WinWaitActive($sWNdTitle)
		ControlClick($sWNdTitle, '', 'ComboBox3')
		Common_SleepInSeconds(0.3)
		For $i = 0 to 3
			Send('{DOWN}')
			Common_SleepInSeconds(0.1)
		Next
		Send('{ENTER}')
		Common_SleepInSeconds(0.3)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ChangeLineArrowEnd_EX($TestCaseID, $sLogFileName1,$sWNdTitle)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func AddPencilMarkInPDF()
	MouseClick('left',1154, 417)
	Common_SleepInSeconds(0.2) 
	MouseClickDrag('left',416, 198, 706, 400)
	Send('{ESC}')
	Common_SleepInSeconds(0.2) 
EndFunc

Func DoubleClickAddedPencilMark($TestCaseID, $sLogFileName1)
	MouseClick('left', 550, 292, 3)
	If WinWait($sPencilMarkPropertiesWnd, '', 5) Then
		WinActivate($sPencilMarkPropertiesWnd)
		ControlFocus($sPencilMarkPropertiesWnd, '', 1)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'DoubleClickAddedPencilMark($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickBaseNumberingAdd($TestCaseID, $sLogFileName1)
	MouseClick('left',1155, 546)
	Common_SleepInSeconds(0.5) 
	Send('{DOWN}')
	Common_SleepInSeconds(0.1) 
	Send('{ENTER}')
	If WinWait($sBatesNumberingWnd, '', 5)	Then
		WinActivate($sBatesNumberingWnd)
		ControlFocus($sBatesNumberingWnd, '', 1)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & ' ClickBaseNumberingAdd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SetTextInBatesNumbering($TestCaseID, $sLogFileName1, $sText)
	If WinWait($sBatesNumberingWnd, '', 5)	Then
		ControlSend($sBatesNumberingWnd, '', 1080, $sText)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetTextInBatesNumbering($TestCaseID, $sLogFileName1, $sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func BatesNumbering_SetMarginInchesX($TestCaseID, $sLogFileName1, $sText)
	If WinWait($sBatesNumberingWnd, '', 5)	Then
		ControlFocus($sBatesNumberingWnd, '', 1084)
		Common_SleepInSeconds(0.2)
		For $i = 0 To 5
			Send('{DEL}')
		Next
		For $i = 0 To 5
			Send('{BS}')
		Next	
		ControlSend($sBatesNumberingWnd, '', 1084, $sText)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'BatesNumbering_SetMarginInchesX($TestCaseID, $sLogFileName1, $sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func BatesNumbering_SetMarginInchesY($TestCaseID, $sLogFileName1, $sText)
	If WinWait($sBatesNumberingWnd, '', 5)	Then
		ControlFocus($sBatesNumberingWnd, '', 1103)
		Common_SleepInSeconds(0.2)
		For $i = 0 To 5
			Send('{DEL}')
		Next		
		For $i = 0 To 5
			Send('{BS}')
		Next
		ControlSend($sBatesNumberingWnd, '', 1103, $sText)
		Common_SleepInSeconds(0.3) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'BatesNumbering_SetMarginInchesY($TestCaseID, $sLogFileName1, $sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func BatesNumbering_SetMarginXPosion($TestCaseID, $sLogFileName1, $sText)
	If WinWait($sBatesNumberingWnd, '', 5)	Then
		ControlClick($sBatesNumberingWnd, '', 'ComboBox4')
		Common_SleepInSeconds(0.5) 
		If $sText = 'Left' Then
		ElseIf $sText = 'Right' Then
			Send('{DOWN}')
		ElseIf $sText = 'Center' Then
			Send('{DOWN}')	
			Send('{DOWN}')
		EndIf	
		Common_SleepInSeconds(0.2)
		Send('{ENTER}')	
		Return True
	EndIf
	Common_WriteLog($sFaile & 'BatesNumbering_SetMarginXPosion($TestCaseID, $sLogFileName1, $sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func BatesNumbering_SetMarginYPosion($TestCaseID, $sLogFileName1, $sText)
	If WinWait($sBatesNumberingWnd, '', 5)	Then
		ControlClick($sBatesNumberingWnd, '', 'ComboBox5')
		Common_SleepInSeconds(0.5) 
		If $sText = 'Top' Then
		ElseIf $sText = 'Bottom' Then
			Send('{DOWN}')
		EndIf	
		Common_SleepInSeconds(0.2)
		Send('{ENTER}')	
		Return True
	EndIf
	Common_WriteLog($sFaile & 'BatesNumbering_SetMarginYPosion($TestCaseID, $sLogFileName1, $sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickInsertBatesNumberBtn($TestCaseID, $sLogFileName1)
	ControlClick($sBatesNumberingWnd, '', 1081)
	If WinWait($sBatesOptionsWnd) Then
		WinActivate($sBatesOptionsWnd)
		Common_SleepInSeconds(0.5) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickInsertBatesNumberBtn($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SetNumberofDigits($sText,$TestCaseID, $sLogFileName1)
	If WinWait($sBatesOptionsWnd) Then
		ControlSetText($sBatesOptionsWnd, '', 1090, $sText)
		Common_SleepInSeconds(0.2)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetNumberofDigits($sText,$TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func SetStartNumber($sText,$TestCaseID, $sLogFileName1)
	If WinWait($sBatesOptionsWnd) Then
		ControlSetText($sBatesOptionsWnd, '', 1102, $sText)
		Common_SleepInSeconds(0.2)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetStartNumber($sText,$TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func SetPrefix($sText,$TestCaseID, $sLogFileName1)
	If WinWait($sBatesOptionsWnd) Then
		ControlSetText($sBatesOptionsWnd, '', 1104, $sText)
		Common_SleepInSeconds(0.2)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetPrefix($sText,$TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func SetSuffix($sText,$TestCaseID, $sLogFileName1)
	If WinWait($sBatesOptionsWnd) Then
		ControlSetText($sBatesOptionsWnd, '', 1105, $sText)
		Common_SleepInSeconds(0.2)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetSuffix($sText,$TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False		
EndFunc

Func ClickRedactionAdd($TestCaseID, $sLogFileName1)
	MouseClick('left',1139, 578)
	Common_SleepInSeconds(0.5) 
	Send('{DOWN}')
	Common_SleepInSeconds(0.1) 
	Send('{ENTER}')
	Common_SleepInSeconds(1) 
EndFunc

Func ClickRedactionAdd_($TestCaseID, $sLogFileName1)
	MouseClick('left',1139, 578)
	Common_SleepInSeconds(0.5) 
	Send('{DOWN}')
	Common_SleepInSeconds(0.1) 
	Send('{ENTER}')
	If WinWait($sRedactionOptionsWnd) Then 
		WinActivate($sRedactionOptionsWnd)
		Common_SleepInSeconds(0.2) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickRedactionAdd_($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func ClickRedactionFind($TestCaseID, $sLogFileName1)
	MouseClick('left',1139, 578)
	Common_SleepInSeconds(0.5) 
	Send('{DOWN}')
	Common_SleepInSeconds(0.1) 
	Send('{DOWN}')
	Common_SleepInSeconds(0.1) 
	Send('{ENTER}')
	If WinWait($sSearchandRedactWnd) Then 
		WinActivate($sSearchandRedactWnd)
		Common_SleepInSeconds(0.2) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickRedactionFind($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func CheckInCheckBoxInSearchandRedactWnd($TestCaseID, $sLogFileName1,$sOption)
	If WinWait($sSearchandRedactWnd) Then 
		WinActivate($sSearchandRedactWnd)
		If $sOption == 'Whole word only' Then
			ControlClick($sSearchandRedactWnd, '', 1117)
		ElseIf $sOption == 'Case sensitive' Then
			ControlClick($sSearchandRedactWnd, '', 1118)
		ElseIf $sOption == 'Backward' Then	
			ControlClick($sSearchandRedactWnd, '', 1123)
		EndIf
		Return True
	EndIf
	Common_WriteLog($sFaile & 'CheckInCheckBoxInSearchandRedactWnd($TestCaseID, $sLogFileName1,$sOption)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SetSrachContentInSearchandRedactWnd($TestCaseID, $sLogFileName1,$sText)
	If WinWait($sSearchandRedactWnd) Then 
		WinActivate($sSearchandRedactWnd)
		ControlSetText($sSearchandRedactWnd, '', 1116, $sText)
		Return True
	EndIf
	Common_WriteLog($sFaile & ' SetSrachContentInSearchandRedactWnd($TestCaseID, $sLogFileName1,$sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickSearchNextInSearchandRedactWnd($TestCaseID, $sLogFileName1, $isCloseWnd)
	If WinWait($sSearchandRedactWnd) Then 
		WinActivate($sSearchandRedactWnd)
		ControlClick($sSearchandRedactWnd, '', 1120)
		If $isCloseWnd == True Then
			Send('{ESC}')
		EndIf
		Common_SleepInSeconds(0.5) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickSearchNextInSearchandRedactWnd($TestCaseID, $sLogFileName1, $isCloseWnd)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickRedactInSearchandRedactWnd($TestCaseID, $sLogFileName1)
	If WinWait($sSearchandRedactWnd) Then 
		WinActivate($sSearchandRedactWnd)
		ControlClick($sSearchandRedactWnd, '', 1121)
		Common_SleepInSeconds(0.5) 
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickRedactInSearchandRedactWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func ClickOptionInSearchandRedactWnd($TestCaseID, $sLogFileName1)
	If WinWait($sSearchandRedactWnd) Then 
		WinActivate($sSearchandRedactWnd)
		ControlClick($sSearchandRedactWnd, '', 3)
		If WinWait ($sRedactionOptionsWnd , '', 5) Then
			Common_SleepInSeconds(0.5) 
			Return True
		EndIf
	EndIf
	Common_WriteLog($sFaile & 'ClickRedactInSearchandRedactWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectTxtInPDF()
	MouseClickDrag('left', 439, 255, 845, 254)
	Common_SleepInSeconds(0.3)
EndFunc

Func ClickRedactionAddLink()
	MouseClick('left',1142, 609)
	Common_SleepInSeconds(1) 
EndFunc

Func ClickRedactionAddLink_()
	MouseClick('left',1142, 609)
	If WinWait($sPageViwerAlertTitle, $sPageViwerAlertMsg) Then
		WinActivate($sPageViwerAlertTitle, $sPageViwerAlertMsg)
		Send('{ENTER}')
	EndIf
EndFunc

Func SelectAreaToAddLink()
	MouseClickDrag('left', 657, 353, 710, 390)
EndFunc

Func ClickNextBtnInCreateLinkWnd($TestCaseID, $sLogFileName1)
	If WinWait($sCreateLinkWnd, '', 5) Then
		ControlClick($sCreateLinkWnd, '', 1048)
		Common_SleepInSeconds(0.3)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'ClickNextBtnInCreateLinkWnd($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SetValueInCreategotoviewWnd($TestCaseID, $sLogFileName1,$sText)
	If WinWait($sCreategotoviewWnd, '', 5) Then
		ControlSetText($sCreategotoviewWnd, '', 1052, $sText)
		Common_SleepInSeconds(0.1)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetValueInCreategotoviewWnd($TestCaseID, $sLogFileName1,$sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectHighlightStyle($TestCaseID, $sLogFileName1,$sText)
	If WinWait($sCreateLinkWnd, '', 5) Then
		WinActivate($sCreateLinkWnd)
		ControlClick($sCreateLinkWnd,'','ComboBox2')
		Common_SleepInSeconds(0.4)
		If $sText == 'Dashed' Then
			Send('{DOWN}')
			Common_SleepInSeconds(0.1)
		ElseIf  $sText == 'Underline' Then
			Send('{DOWN}')
			Common_SleepInSeconds(0.1)	
			Send('{DOWN}')
			Common_SleepInSeconds(0.1)	
		ElseIf  $sText == 'Solid' Then		
		EndIf
		Send('{ENTER}')
		Common_SleepInSeconds(0.3)	
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectHighlightStyle($TestCaseID, $sLogFileName1,$sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectLineThickness($TestCaseID, $sLogFileName1,$sText)
	If WinWait($sCreateLinkWnd, '', 5) Then
		WinActivate($sCreateLinkWnd)
		ControlClick($sCreateLinkWnd,'','ComboBox3')
		Common_SleepInSeconds(0.4)
		If $sText == 'Medium' Then
			Send('{UP}')
			Common_SleepInSeconds(0.1)
		ElseIf  $sText == 'Thin' Then
			Send('{UP}')
			Common_SleepInSeconds(0.1)	
			Send('{UP}')
			Common_SleepInSeconds(0.1)	
		ElseIf  $sText == 'Thick' Then		
		EndIf
		Send('{ENTER}')
		Common_SleepInSeconds(0.3)	
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectLineThickness($TestCaseID, $sLogFileName1,$sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectOptionInCreateLinkWnd($TestCaseID, $sLogFileName1,$sText)
	If WinWait($sCreateLinkWnd, '', 5) Then
		WinActivate($sCreateLinkWnd)
		Common_SleepInSeconds(0.4)
		If $sText == 'Go to a page view' Then
			ControlClick($sCreateLinkWnd, '', 1044)
			Common_SleepInSeconds(0.1)
		ElseIf  $sText == 'Open a web page' Then
			ControlClick($sCreateLinkWnd, '', 1046)
		ElseIf  $sText == 'Open a file' Then
			ControlClick($sCreateLinkWnd, '', 1045)
		EndIf
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectOptionInCreateLinkWnd($TestCaseID, $sLogFileName1,$sText)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SelectFileForAddedLink($TestCaseID, $sLogFileName1, $sFileName)
	If WinWait($sOpenWnd, $sOpenWndText, 5) Then
		WinActivate($sOpenWnd, $sOpenWndText)
		Common_SleepInSeconds(0.5)
		ControlSetText($sOpenWnd, $sOpenWndText, 1148, $sFileName)   ;set file name
		Common_SleepInSeconds(0.3)
		ControlClick($sOpenWnd, $sOpenWndText, 1)   ;OK button
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectFileForAddedLink($TestCaseID, $sLogFileName1, $sFileName)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func DoubleClickAddedLink()
	MouseClick('left', 690, 380)
	Common_SleepInSeconds(4)
EndFunc

Func SelectInvisibleRecatangle()
	ControlClick($sCreateLinkWnd, '', 'ComboBox1')
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.1)
	Send('{ENTER}')
	Common_SleepInSeconds(0.3)
EndFunc

Func OpenPDFMenu()
	Send('!p')
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickSaveAs_PropertyBtn($TestCaseID, $sLogFileName1)
	If WinWait($sCommonWndClass, $sSaveAsWndText, 5) Then
		WinActivate($sCommonWndClass, $sSaveAsWndText)
		ControlClick($sCommonWndClass, $sSaveAsWndText, 1021)    
		If WinWait($sPreferencesWnd, '', 5) Then
			WinActivate($sPreferencesWnd)
			Common_SleepInSeconds(0.5)
			Return True
		EndIf
	EndIf
	Common_WriteLog($sFaile & 'ClickSaveAs_PropertyBtn($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SetJPGMaxHighCompression($TestCaseID, $sLogFileName1)
	If WinWait($sPreferencesWnd, '', 5) Then
		WinActivate($sPreferencesWnd)
		For $i = 0 To 50
			Send('{LEFT}')
		Next
		Common_SleepInSeconds(0.5)
		ControlClick($sPreferencesWnd, '', 1)
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetJPGMaxHighCompression($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SetJPGMaxHighQualilty($TestCaseID, $sLogFileName1)
	If WinWait($sPreferencesWnd, '', 5) Then
		WinActivate($sPreferencesWnd)
		For $i = 0 To 50
			Send('{RIGHT}')
		Next
		Common_SleepInSeconds(0.5)
		ControlClick($sPreferencesWnd, '', 1)
		Common_SleepInSeconds(0.5)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetJPGMaxHighQualilty($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SelectMergePDFFromToolsMenu($TestCaseID, $sLogFileName1)
	Send('!t')
	Common_SleepInSeconds(0.5)
	Send('m')
	If WinWait($sSaveAllFilesAsWnd, '', 5) Then
		WinActivate($sSaveAllFilesAsWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectMergePDFFromToolsMenu($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False	
EndFunc

Func SelectSplitPDFFromMenu($TestCaseID, $sLogFileName1)
	Send('!p')
	Common_SleepInSeconds(0.5)
	Send('{ENTER}')
	If WinWait($sSplitPDFSettingsWnd, '', 5) Then
		WinActivate($sSplitPDFSettingsWnd)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SelectSplitPDFFromMenu($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SetSplitFileName($TestCaseID, $sLogFileName1,$sName)
	If WinWait($sSplitPDFSettingsWnd, '', 5) Then
		WinActivate($sSplitPDFSettingsWnd)
		ControlSetText($sSplitPDFSettingsWnd, '', 1133,$sName)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetSplitFileName($TestCaseID, $sLogFileName1,$sName)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func SetSplitFileStartNumber($TestCaseID, $sLogFileName1,$sName)
	If WinWait($sSplitPDFSettingsWnd, '', 5) Then
		WinActivate($sSplitPDFSettingsWnd)
		ControlSetText($sSplitPDFSettingsWnd, '', 1134,$sName)
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetSplitFileStartNumber($TestCaseID, $sLogFileName1,$sName)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc

Func OpenProtectPDF()
	Common_SleepInSeconds(5)
	Send('123')
	Common_SleepInSeconds(0.5)
	Send('{ENTER}')
EndFunc

Func SearchInPDF($stext)
	For $i = 0 to 40
		Send('{DEL}')
	Next
	Common_SleepInSeconds(0.2)
	Send($stext)
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickSearPreviousBtn()
	MouseClick('left',653, 60)
	Common_SleepInSeconds(0.3)
EndFunc

Func ClickSearNextBtn()
	MouseClick('left',699, 61)
	Common_SleepInSeconds(0.3)
EndFunc

Func SearchPreMenu()
	Send('!e')
	Common_SleepInSeconds(0.5)
	Send('v')
	Common_SleepInSeconds(0.3)
EndFunc

Func SearchNextMenu()
	Send('!e')
	Common_SleepInSeconds(0.5)
	Send('t')
	Common_SleepInSeconds(0.3)
EndFunc

Func ClickHighLightBtnInXPSView()
	MouseClick('left',1120, 222)
EndFunc

Func AddHighlihtInXPS()
	MouseClickDrag('left',326, 324, 502, 441)
EndFunc

Func SelectAreaInXPS()
	MouseClickDrag('left',326, 324, 502, 441)
EndFunc

Func SelectAreaInXPS_()
	MouseClickDrag('left',306, 324, 502, 441)
EndFunc

Func ClickStickNoteButton()
	MouseClick('left',1119, 291)
EndFunc

Func ClickInkStickNoteButton()
	MouseClick('left',1194, 294)
EndFunc

Func ClickRemoveStickNoteButton()
	MouseClick('left',1157, 292)
EndFunc

Func ClickRemoveInkStickNoteButton()
	MouseClick('left',1233, 292)
EndFunc

Func AddTestStickyNote()
	Send('test')
	Common_SleepInSeconds(0.3)
	MouseClick('left',527, 371)
	Common_SleepInSeconds(0.8)
EndFunc

Func AddInkNote()
	MouseClickDrag('left',340, 400, 360, 450)
	Common_SleepInSeconds(0.3)
EndFunc

Func ClearHighLightButton()
	MouseClickDrag('left',326, 324, 502, 441)
	MouseClick('left',1157, 221)
	Common_SleepInSeconds(0.5)
EndFunc

Func SelectCloseOnFileList()
	Send('{UP}')
	Common_SleepInSeconds(0.1)
	Send('{UP}')
	Common_SleepInSeconds(0.1)
	Send('{ENTER}')
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickHightLightBtnInDocview()
	MouseClick('left',1105, 212)
EndFunc

Func AddHighlightInDociewFromMenu()
	Send('!d')
	Common_SleepInSeconds(0.5)
	Send('a')
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickAddBookMarkBtnInDocview()
	MouseClick('left',1108, 275)
EndFunc

Func AddBookMarkInDociewFromMenu()
	Send('!d')
	Common_SleepInSeconds(0.5)
	Send('d')
	Common_SleepInSeconds(0.5)
EndFunc

Func ClickClearHightLightBtnInDocview()
	MouseClick('left',1145, 211)
EndFunc

Func ClickClearBookMarkBtnInDocview()
	MouseClick('left',1145, 277)
EndFunc

Func ClickPreviewHightLightBtnInDocview()
	MouseClick('left',1186, 212)
EndFunc

Func ClickNextHightLightBtnInDocview()
	MouseClick('left',1222, 213)
EndFunc

Func ClickPreviewBookMarkBtnInDocview()
	MouseClick('left',1184, 280)
EndFunc

Func ClickNextBookMarkBtnInDocview()
	MouseClick('left',1221, 280)
EndFunc

Func SelectMatchCaseForSearch()
	MouseClick('left',626, 62)
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)
	Send('{ENTER}')
	Common_SleepInSeconds(0.3)
EndFunc

Func SearchPrevieMenu()
	Send('!e')
	Common_SleepInSeconds(0.5)
	Send('v')	
	Common_SleepInSeconds(0.5)
EndFunc

Func SaveAsFromContextMenu()
	MouseClick('right',600, 400)
	Common_SleepInSeconds(0.5)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)
	Send('{DOWN}')
	Common_SleepInSeconds(0.3)	
	Send('{ENTER}')
	Common_SleepInSeconds(0.3)	
EndFunc

Func SwitchToOCRViewFromContextMenu()
	Send('{DOWN}')
	Common_SleepInSeconds(0.2)
	Send('{DOWN}')
	Common_SleepInSeconds(0.2)	
	Send('{RIGHT}')
	Common_SleepInSeconds(0.5)	
	Send('{UP}')
	Common_SleepInSeconds(0.2)
	Send('{ENTER}')
EndFunc

Func ClickSelectBtnInOCRView()
	MouseClick('left',1106, 146)
EndFunc

Func ClickMoveBtnInOCRView()
	MouseClick('left',1145, 148)
EndFunc

Func ClickDeleteCurrentCharBtnInOCRView()
	MouseClick('left',1108, 213)
EndFunc

Func ClickAddAfterCurrentCharBtnInOCRView()
	MouseClick('left',1145, 212)
EndFunc

Func ClickAddBeforeCurrentCharBtnInOCRView()
	MouseClick('left',1181, 213)
EndFunc

Func DeleteCurrentCharMenuInOCRView()
	Send('!o')
	Common_SleepInSeconds(0.5)	
	Send('d')
	Common_SleepInSeconds(0.5)	
EndFunc

Func AddBeforeCurrentCharMenuInOCRView()
	Send('!o')
	Common_SleepInSeconds(0.5)	
	Send('b')
	Common_SleepInSeconds(0.5)	
EndFunc

Func AddAfterCurrentCharMenuInOCRView()
	Send('!o')
	Common_SleepInSeconds(0.5)	
	Send('a')
	Common_SleepInSeconds(0.5)	
EndFunc

Func ClickPreferenceOnToolsBar($TestCaseID, $sLogFileName1)
	MouseClick('left',518, 60)
	If WinWait($sPreferencesWnd, '', 5) Then
		WinActivate($sPreferencesWnd)
		Common_SleepInSeconds(1)	
		Return True
	EndIf
	Common_WriteLog($sFaile & 'SetSplitFileName($TestCaseID, $sLogFileName1)', $TestCaseID, $sLogFileName1, ' ')
	Common_ClosePMWhenException()
	Return False
EndFunc



